Closed tgehrig closed 12 years ago
which key is it, that he doesn't like?
Any key that is directly associated to the fileitem which is not one of the standard keys like "class". So for example, if I have a fileitem and add as property the key "emotion" it results in the above mentioned error.
Well, then I don't understand why this is happening. Can you attach a backtrace?
How should I generate a backtrace? The program does not crash. It just displays that error in the status bar:-/.
Traceback (most recent call last):
File "/home/tgehrig/src/git/labeltool/sloth/gui/labeltool.py", line 357, in fileSaveAs
return self.labeltool.saveAnnotations(str(fname))
File "/home/tgehrig/src/git/labeltool/sloth/core/labeltool.py", line 247, in saveAnnotations
ann = self._model.root().getAnnotations()
File "/home/tgehrig/src/git/labeltool/sloth/annotations/model.py", line 281, in getAnnotations
return [child.getAnnotations() for child in self.children()]
File "/home/tgehrig/src/git/labeltool/sloth/annotations/model.py", line 452, in getAnnotations
fi['annotations'] = [child.getAnnotations() for child in self.children()]
AttributeError: KeyValueRowModelItem instance has no attribute 'getAnnotations'
When using the OkapiAnnotationContainer it is possible to have attributes directly assigned to the file, which should be fine as far as I could imagine;-). It is also correctly displayed as key-value pairs directly below the filename. But when trying to save the annotations I get the error:
Error: Saving failed (KeyValueRowModelItem instance has no attribute 'getAnnotations')
It I remove all elements in the map for the file besides the filename, class, and the annotations it is working fine.
It can be fixed by patching the code like following, but that is actually not what I want:-/: