hsnr-gamera / gamera-4

Gamera 4 for Python 3
GNU General Public License v2.0
10 stars 8 forks source link

Unable to save glyphs into separate files #68

Closed jsbien closed 1 year ago

jsbien commented 1 year ago

I enclose the console output. runtime-bug.log

cdalitz commented 1 year ago

Thanks for reporting this. Can you please provide a small script that causes this error?

FriedrichFroebel commented 1 year ago

This is part of the GUI and therefore probably hard to put into a script:

Traceback (most recent call last):
  File "/home/jsbien/.local/lib/python3.9/site-packages/gamera/gui/classifier_display.py", line 1455, in _OnSaveSelectedAsImages
    self._OnSaveAsImages(list)
  File "/home/jsbien/.local/lib/python3.9/site-packages/gamera/gui/classifier_display.py", line 1468, in _OnSaveAsImages
    glyphs.sort(lambda g1,g2: cmp(g1.get_main_id().lower(),g2.get_main_id().lower()))
TypeError: sort() takes no positional arguments

This could be fixed by replacing https://github.com/hsnr-gamera/gamera-4/blob/270e499abcb20dd6d77e8df840c3ef0c1ae02a2c/gamera/gui/classifier_display.py#L1468 with

         glyphs.sort(key=lambda g: g.get_main_id().lower())
cdalitz commented 1 year ago

Thanks to @FriedrichFroebel for the quick fix, which I have uploaded to github. @jsbien, can you please check whether this solves your problem?

jsbien commented 1 year ago

Yes, it works now. Thank you very much!