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