mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-28 13:42:36 +01:00
Updated to work with non-absolute selfs again.
This commit is contained in:
parent
ae4b8f7861
commit
bb3df205f2
@ -539,11 +539,16 @@ class Directory(registry.String):
|
||||
return v
|
||||
|
||||
def dirize(self, filename):
|
||||
myself = self()
|
||||
if os.path.isabs(filename):
|
||||
selfAbs = os.path.abspath(self())
|
||||
filename = os.path.abspath(filename)
|
||||
selfAbs = os.path.abspath(myself)
|
||||
commonPrefix = os.path.commonprefix([selfAbs, filename])
|
||||
filename = filename[len(commonPrefix)+1:] # +1 for extra /.
|
||||
return os.path.join(self(), filename)
|
||||
elif not os.path.isabs(myself):
|
||||
if filename.startswith(myself):
|
||||
filename = filename[len(myself):]
|
||||
return os.path.join(myself, filename)
|
||||
|
||||
class DataFilename(registry.String):
|
||||
def __call__(self):
|
||||
|
Loading…
Reference in New Issue
Block a user