add annotation accessor to labeltool object

This commit is contained in:
Martin Baeuml
2011-09-15 13:53:28 +02:00
parent cc6bab33b9
commit 9d4fac6315
2 changed files with 6 additions and 2 deletions
+1 -2
View File
@@ -65,8 +65,7 @@ class DumpLabelsCommand(BaseCommand):
raise CommandError("Expect exactly 1 argument.")
self.labeltool.loadAnnotations(args[0])
# TODO add better accessor the the labeltool
pprint(self.labeltool._container.annotations())
pprint(self.labeltool.annotations())
class AppendFilesCommand(BaseCommand):
+5
View File
@@ -235,6 +235,11 @@ class LabelTool(QObject):
self.statusMessage.emit(msg)
self.annotationsLoaded.emit()
def annotations(self):
if self._model is None:
return None
return self._model.root().getAnnotations()
def saveAnnotations(self, fname):
success = False
try: