From aeee36dcb768bad1d3a982697c9c5ce948b5e0e4 Mon Sep 17 00:00:00 2001 From: Martin Baeuml Date: Tue, 21 Aug 2012 14:12:18 +0200 Subject: [PATCH] appendfiles: don't make an absolute path relative --- sloth/core/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sloth/core/commands.py b/sloth/core/commands.py index 82e824e..ba95819 100644 --- a/sloth/core/commands.py +++ b/sloth/core/commands.py @@ -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