mac-alias 1.0.0__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: mac_alias
3
- Version: 1.0.0
3
+ Version: 1.1.0
4
4
  Summary: Generate/parse Mac OS Alias records from Python
5
5
  Home-page: http://alastairs-place.net/projects/mac_alias
6
6
  Author: Alastair Houghton
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  from __future__ import unicode_literals
3
+ from __future__ import division
3
4
 
4
5
  import struct
5
6
  import datetime
@@ -138,28 +139,28 @@ class TargetInfo (object):
138
139
  self.type_code = type_code
139
140
 
140
141
  #: The depth of the alias? Always seems to be -1 on OS X.
141
- self.levels_from = -1
142
+ self.levels_from = levels_from
142
143
 
143
144
  #: The depth of the target? Always seems to be -1 on OS X.
144
- self.levels_to = -1
145
+ self.levels_to = levels_to
145
146
 
146
147
  #: The (POSIX) name of the target's containing folder. *(optional)*
147
- self.folder_name = None
148
+ self.folder_name = folder_name
148
149
 
149
150
  #: The path from the volume root as a sequence of CNIDs. *(optional)*
150
- self.cnid_path = None
151
+ self.cnid_path = cnid_path
151
152
 
152
153
  #: The Carbon path of the target *(optional)*
153
- self.carbon_path = None
154
+ self.carbon_path = carbon_path
154
155
 
155
156
  #: The POSIX path of the target relative to the volume root. Note
156
157
  #: that this may or may not have a leading '/' character, but it is
157
158
  #: always relative to the containing volume. *(optional)*
158
- self.posix_path = None
159
+ self.posix_path = posix_path
159
160
 
160
161
  #: If the path points into a user's home folder, the number of folders
161
162
  #: deep that we go before we get to that home folder. *(optional)*
162
- self.user_home_prefix_len = None
163
+ self.user_home_prefix_len = user_home_prefix_len
163
164
 
164
165
  def __repr__(self):
165
166
  args = ['kind', 'filename', 'folder_cnid', 'cnid', 'creation_date',
@@ -262,7 +263,7 @@ class Alias (object):
262
263
  if tag == TAG_CARBON_FOLDER_NAME:
263
264
  alias.target.folder_name = value.replace('/',':')
264
265
  elif tag == TAG_CNID_PATH:
265
- alias.target.cnid_path = struct.unpack(b'>%uI' % (length / 4),
266
+ alias.target.cnid_path = struct.unpack(b'>%uI' % (length // 4),
266
267
  value)
267
268
  elif tag == TAG_CARBON_PATH:
268
269
  alias.target.carbon_path = value
@@ -482,7 +483,7 @@ class Alias (object):
482
483
  if len(ai.server) & 1:
483
484
  b.write(b'\0')
484
485
  if ai.username:
485
- b.write(struct.pack(b'>hh', TAG_APPLESHARE_SERVER_NAME,
486
+ b.write(struct.pack(b'>hh', TAG_APPLESHARE_USERNAME,
486
487
  len(ai.username)))
487
488
  b.write(ai.username)
488
489
  if len(ai.username) & 1:
@@ -513,13 +514,13 @@ class Alias (object):
513
514
  utf16 = self.target.filename.replace(':','/').encode('utf-16-be')
514
515
  b.write(struct.pack(b'>hhh', TAG_UNICODE_FILENAME,
515
516
  len(utf16) + 2,
516
- len(utf16) / 2))
517
+ len(utf16) // 2))
517
518
  b.write(utf16)
518
519
 
519
520
  utf16 = self.volume.name.replace(':','/').encode('utf-16-be')
520
521
  b.write(struct.pack(b'>hhh', TAG_UNICODE_VOLUME_NAME,
521
522
  len(utf16) + 2,
522
- len(utf16) / 2))
523
+ len(utf16) // 2))
523
524
  b.write(utf16)
524
525
 
525
526
  if self.target.posix_path:
@@ -9,7 +9,7 @@ import uuid
9
9
 
10
10
  from .utils import *
11
11
 
12
- libc = cdll.LoadLibrary('libc.dylib')
12
+ libc = cdll.LoadLibrary('/usr/lib/libc.dylib')
13
13
 
14
14
  # Constants
15
15
  FSOPT_NOFOLLOW = 0x00000001
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 1.1
2
2
  Name: mac-alias
3
- Version: 1.0.0
3
+ Version: 1.1.0
4
4
  Summary: Generate/parse Mac OS Alias records from Python
5
5
  Home-page: http://alastairs-place.net/projects/mac_alias
6
6
  Author: Alastair Houghton
@@ -2,7 +2,7 @@
2
2
  from setuptools import setup
3
3
 
4
4
  setup(name='mac_alias',
5
- version='1.0.0',
5
+ version='1.1.0',
6
6
  description='Generate/parse Mac OS Alias records from Python',
7
7
  long_description=u"""
8
8
  ``mac_alias`` lets you generate or read binary Alias records from Python code.
File without changes
File without changes