appendfiles: don't make an absolute path relative

This commit is contained in:
Martin Baeuml
2012-08-21 14:12:18 +02:00
parent 96794b3afe
commit aeee36dcb7
+4 -1
View File
@@ -101,7 +101,8 @@ class AppendFilesCommand(BaseCommand):
for filename in args[1:]:
rel_filename = filename
try:
rel_filename = os.path.relpath(filename, os.path.dirname(args[0]))
if not os.path.isabs(filename):
rel_filename = os.path.relpath(filename, os.path.dirname(args[0]))
except:
pass
@@ -117,6 +118,7 @@ class AppendFilesCommand(BaseCommand):
item.setUnlabeled(True)
self.labeltool.saveAnnotations(args[0])
class MergeFilesCommand(BaseCommand):
"""
Merge annotations of two label files and create a new one from it.
@@ -202,6 +204,7 @@ class MergeFilesCommand(BaseCommand):
return an1
def _make_writeable(filename):
"""
Make sure that the file is writeable. Useful if our source is