Closed brdiep113 closed 9 months ago
Fixed!
Last sign before deletion:
After deleting:
From the perspective of the GUI, everything looks good. That said, I'm still getting a ValueError (see terminal output below). It appears to be due to
Corpus.get_previous_sign()
returning None when there is only one gloss in the list.Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.1\plugins\python-ce\helpers\pydev\pydevd.py", line 2195, in <module> main() File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.1\plugins\python-ce\helpers\pydev\pydevd.py", line 2177, in main globals = debugger.run(setup['file'], None, None, is_module) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.1\plugins\python-ce\helpers\pydev\pydevd.py", line 1489, in run return self._exec(is_module, entry_point_fn, module_name, file, globals, locals) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.1\plugins\python-ce\helpers\pydev\pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\JetBrains\PyCharm Community Edition 2022.3.1\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "C:\Users\kvesik\Documents\School\RA-KCH\GitHub\SLPAA\src\main\python\main.py", line 8, in <module> exit_code = appctxt.run() ^^^^^^^^^^^^^ File "C:\Users\kvesik\Documents\School\RA-KCH\GitHub\SLPAA\src\main\python\gui\app.py", line 15, in run return self.app.exec_() ^^^^^^^^^^^^^^^^ File "C:\Users\kvesik\Documents\School\RA-KCH\GitHub\SLPAA\src\main\python\gui\main_window.py", line 946, in on_action_delete_sign self.select_sign([previous]) File "C:\Users\kvesik\Documents\School\RA-KCH\GitHub\SLPAA\src\main\python\gui\main_window.py", line 956, in select_sign indices.append(list(self.corpus.signs).index(sign)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: None is not in list
My bad I think I forgot to push the last commit I made to fix that. I don't get any ValueErrors in my terminal now when I delete the last sign.
Thanks! Looks good with additional commit.
Issue #78 - Deleting signs now highlights correctly according to expected behaviour
Case 1: There is more than 1 sign in the list, sign to be deleted is not the first in the corpus Before deletion:
After deletion: (preceding sign is now highlighted)
![image](https://github.com/PhonologicalCorpusTools/SLPAA/assets/51172655/d9dab61d-90a4-4a1a-9de5-4cbd7db120ef)
Case 2: There is more than 1 sign in the list, sign to be deleted is the first in the corpus Before deletion:
After deletion: (following sign is now highlighted)
![image](https://github.com/PhonologicalCorpusTools/SLPAA/assets/51172655/86c74d2f-f77b-4560-987c-91cb98798ec0)
Case 3: There is only 1 sign left in the corpus that is to be deleted. Before deletion:
After deletion: (no signs are left in the corpus)
![image](https://github.com/PhonologicalCorpusTools/SLPAA/assets/51172655/ccf9cb3f-d496-46b6-b362-ec8ced32a51b)