Yin-Yang icon indicating copy to clipboard operation
Yin-Yang copied to clipboard

crashes with older preferences file

Open sevu opened this issue 5 years ago • 2 comments
trafficstars

I installed this months ago, and wanted to try it out again. It crashes when clicking the settings-button:

Traceback (most recent call last):
File "/opt/yin-yang/src/gui.py", line 331, in open_settings
self.secwindow = SettingsWindow()
File "/opt/yin-yang/src/gui.py", line 23, in __init__
self.sync_with_config()
File "/opt/yin-yang/src/gui.py", line 108, in sync_with_config
self.ui.kvantum_line_light.setText(config.get("kvantumLightTheme"))
File "/opt/yin-yang/src/config.py", line 195, in get
return config[key]
KeyError: 'kvantumLightTheme'

Also, clicking the dark/light buttons triggers:

Exception in thread Thread-25:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/opt/yin-yang/src/yin_yang.py", line 53, in run
if config.get("gnomeEnabled"):
File "/opt/yin-yang/src/config.py", line 195, in get
return config[key]
KeyError: 'gnomeEnabled'

(note the thread count too, with each click it increased)

Starting with a fresh settings file helped. That is my old one: https://pastebin.com/5HfV9Ua0

Btw, I cannot terminate the program from the terminal I started it using CTRL + C / SIGINT.

sevu avatar Oct 11 '20 22:10 sevu

Hey, thanks for raising this I was not aware! I recently merged a pr that was adding new flags for the config. Indeed the CTRL-C did not work to quit the program, you will need to use the gui. For now the fix is to just reinstall the tool.

oskarsh avatar Oct 13 '20 18:10 oskarsh

Is this due to the keys 'gnomeEnabled' and 'kvantumLightTheme' not being present in older versions? Perhaps instead of a versioning system we should attempt to read all of the known settings and default any ones which don't exist.

chase9 avatar Oct 27 '20 16:10 chase9

We now have methods for updating the config, this should not happen anymore

l0drex avatar Oct 01 '22 10:10 l0drex