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.
- {mac_alias-1.0.0 → mac_alias-1.1.0}/PKG-INFO +1 -1
- {mac_alias-1.0.0 → mac_alias-1.1.0}/mac_alias/alias.py +12 -11
- {mac_alias-1.0.0 → mac_alias-1.1.0}/mac_alias/osx.py +1 -1
- {mac_alias-1.0.0 → mac_alias-1.1.0}/mac_alias.egg-info/PKG-INFO +1 -1
- {mac_alias-1.0.0 → mac_alias-1.1.0}/setup.py +1 -1
- {mac_alias-1.0.0 → mac_alias-1.1.0}/mac_alias/__init__.py +0 -0
- {mac_alias-1.0.0 → mac_alias-1.1.0}/mac_alias/utils.py +0 -0
- {mac_alias-1.0.0 → mac_alias-1.1.0}/mac_alias.egg-info/SOURCES.txt +0 -0
- {mac_alias-1.0.0 → mac_alias-1.1.0}/mac_alias.egg-info/dependency_links.txt +0 -0
- {mac_alias-1.0.0 → mac_alias-1.1.0}/mac_alias.egg-info/top_level.txt +0 -0
- {mac_alias-1.0.0 → mac_alias-1.1.0}/setup.cfg +0 -0
|
@@ -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 =
|
|
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 =
|
|
145
|
+
self.levels_to = levels_to
|
|
145
146
|
|
|
146
147
|
#: The (POSIX) name of the target's containing folder. *(optional)*
|
|
147
|
-
self.folder_name =
|
|
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 =
|
|
151
|
+
self.cnid_path = cnid_path
|
|
151
152
|
|
|
152
153
|
#: The Carbon path of the target *(optional)*
|
|
153
|
-
self.carbon_path =
|
|
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 =
|
|
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 =
|
|
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
|
|
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',
|
|
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)
|
|
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)
|
|
523
|
+
len(utf16) // 2))
|
|
523
524
|
b.write(utf16)
|
|
524
525
|
|
|
525
526
|
if self.target.posix_path:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|