mac-alias 2.0.5__tar.gz → 2.0.7__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.
- {mac_alias-2.0.5 → mac_alias-2.0.7}/PKG-INFO +1 -1
- {mac_alias-2.0.5 → mac_alias-2.0.7}/mac_alias/alias.py +9 -9
- {mac_alias-2.0.5 → mac_alias-2.0.7}/mac_alias/bookmark.py +3 -9
- {mac_alias-2.0.5 → mac_alias-2.0.7}/mac_alias.egg-info/PKG-INFO +1 -1
- {mac_alias-2.0.5 → mac_alias-2.0.7}/setup.py +1 -1
- {mac_alias-2.0.5 → mac_alias-2.0.7}/README.rst +0 -0
- {mac_alias-2.0.5 → mac_alias-2.0.7}/mac_alias/__init__.py +0 -0
- {mac_alias-2.0.5 → mac_alias-2.0.7}/mac_alias/osx.py +0 -0
- {mac_alias-2.0.5 → mac_alias-2.0.7}/mac_alias/utils.py +0 -0
- {mac_alias-2.0.5 → mac_alias-2.0.7}/mac_alias.egg-info/SOURCES.txt +0 -0
- {mac_alias-2.0.5 → mac_alias-2.0.7}/mac_alias.egg-info/dependency_links.txt +0 -0
- {mac_alias-2.0.5 → mac_alias-2.0.7}/mac_alias.egg-info/top_level.txt +0 -0
- {mac_alias-2.0.5 → mac_alias-2.0.7}/setup.cfg +0 -0
|
@@ -258,10 +258,10 @@ class Alias (object):
|
|
|
258
258
|
alias = Alias()
|
|
259
259
|
alias.appinfo = appinfo
|
|
260
260
|
|
|
261
|
-
alias.volume = VolumeInfo (volname.replace('/',':'),
|
|
261
|
+
alias.volume = VolumeInfo (volname.decode().replace('/',':'),
|
|
262
262
|
voldate, fstype, disktype,
|
|
263
263
|
volattrs, volfsid)
|
|
264
|
-
alias.target = TargetInfo (kind, filename.replace('/',':'),
|
|
264
|
+
alias.target = TargetInfo (kind, filename.decode().replace('/',':'),
|
|
265
265
|
folder_cnid, cnid,
|
|
266
266
|
crdate, creator_code, type_code)
|
|
267
267
|
alias.target.levels_from = levels_from
|
|
@@ -276,9 +276,9 @@ class Alias (object):
|
|
|
276
276
|
b.read(1)
|
|
277
277
|
|
|
278
278
|
if tag == TAG_CARBON_FOLDER_NAME:
|
|
279
|
-
alias.target.folder_name = value.replace('/',':')
|
|
279
|
+
alias.target.folder_name = value.decode().replace('/',':')
|
|
280
280
|
elif tag == TAG_CNID_PATH:
|
|
281
|
-
alias.target.cnid_path = struct.unpack(
|
|
281
|
+
alias.target.cnid_path = struct.unpack('>%uI' % (length // 4),
|
|
282
282
|
value)
|
|
283
283
|
elif tag == TAG_CARBON_PATH:
|
|
284
284
|
alias.target.carbon_path = value
|
|
@@ -313,9 +313,9 @@ class Alias (object):
|
|
|
313
313
|
alias.target.creation_date \
|
|
314
314
|
= mac_epoch + datetime.timedelta(seconds=seconds)
|
|
315
315
|
elif tag == TAG_POSIX_PATH:
|
|
316
|
-
alias.target.posix_path = value
|
|
316
|
+
alias.target.posix_path = value.decode()
|
|
317
317
|
elif tag == TAG_POSIX_PATH_TO_MOUNTPOINT:
|
|
318
|
-
alias.volume.posix_path = value
|
|
318
|
+
alias.volume.posix_path = value.decode()
|
|
319
319
|
elif tag == TAG_RECURSIVE_ALIAS_OF_DISK_IMAGE:
|
|
320
320
|
alias.volume.disk_image_alias = Alias.from_bytes(value)
|
|
321
321
|
elif tag == TAG_USER_HOME_LENGTH_PREFIX:
|
|
@@ -467,12 +467,12 @@ class Alias (object):
|
|
|
467
467
|
|
|
468
468
|
b.write(struct.pack(b'>hhQhhQ',
|
|
469
469
|
TAG_HIGH_RES_VOLUME_CREATION_DATE,
|
|
470
|
-
8,
|
|
470
|
+
8, int(voldate * 65536),
|
|
471
471
|
TAG_HIGH_RES_CREATION_DATE,
|
|
472
|
-
8,
|
|
472
|
+
8, int(crdate * 65536)))
|
|
473
473
|
|
|
474
474
|
if self.target.cnid_path:
|
|
475
|
-
cnid_path = struct.pack(
|
|
475
|
+
cnid_path = struct.pack('>%uI' % len(self.target.cnid_path),
|
|
476
476
|
*self.target.cnid_path)
|
|
477
477
|
b.write(struct.pack(b'>hh', TAG_CNID_PATH,
|
|
478
478
|
len(cnid_path)))
|
|
@@ -317,6 +317,9 @@ class Bookmark (object):
|
|
|
317
317
|
if len(data) < 16:
|
|
318
318
|
raise ValueError('Not a bookmark file (too short)')
|
|
319
319
|
|
|
320
|
+
if isinstance(data, bytearray):
|
|
321
|
+
data = bytes(data)
|
|
322
|
+
|
|
320
323
|
magic,size,dummy,hdrsize = struct.unpack(b'<4sIII', data[0:16])
|
|
321
324
|
|
|
322
325
|
if magic != b'book':
|
|
@@ -595,9 +598,6 @@ class Bookmark (object):
|
|
|
595
598
|
|
|
596
599
|
foldername = os.path.basename(dirname)
|
|
597
600
|
|
|
598
|
-
print(repr(path))
|
|
599
|
-
print(repr(vol_path))
|
|
600
|
-
|
|
601
601
|
rel_path = os.path.relpath(path, vol_path)
|
|
602
602
|
|
|
603
603
|
# Build the path arrays
|
|
@@ -624,12 +624,6 @@ class Bookmark (object):
|
|
|
624
624
|
volprops = Data(struct.pack(b'<QQQ', 0x81 | kCFURLVolumeSupportsPersistentIDs,
|
|
625
625
|
0x13ef | kCFURLVolumeSupportsPersistentIDs, 0))
|
|
626
626
|
|
|
627
|
-
print(repr(name_path))
|
|
628
|
-
print(repr(cnid_path))
|
|
629
|
-
print(repr(fileprops))
|
|
630
|
-
print(repr(vol_path))
|
|
631
|
-
print(repr(vol_name))
|
|
632
|
-
|
|
633
627
|
toc = {
|
|
634
628
|
kBookmarkPath: name_path,
|
|
635
629
|
kBookmarkCNIDPath: cnid_path,
|
|
@@ -19,7 +19,7 @@ with open('README.rst', 'rb') as f:
|
|
|
19
19
|
longdesc = f.read().decode('utf-8')
|
|
20
20
|
|
|
21
21
|
setup(name='mac_alias',
|
|
22
|
-
version='2.0.
|
|
22
|
+
version='2.0.7',
|
|
23
23
|
description='Generate/parse Mac OS Alias records from Python',
|
|
24
24
|
long_description=longdesc,
|
|
25
25
|
author='Alastair Houghton',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|