chaosparrot / talon_hud

Unofficial Talon Head Up Display scripts
68 stars 29 forks source link

ValueError: dimensions persisted as float, parsed later as int. #32

Closed ghouston closed 1 year ago

ghouston commented 1 year ago

yesterday i setup talon + hud on a new machine. i used the 'drag' and 'resize' commands to resize the status widget. today after rebooting, i got an error when starting talon

     1: user/talon_hud/widget_preferences.py:140| self.x = int(persisted_dict[id + "_x"])
ValueError: invalid literal for int() with base 10: '1348.0'

from which you can see it had persisted a float value and now attempts to parse it as int. so for a quick fix i locally changed lines that parse the dimension like so

            self.x = int(float(persisted_dict[id + "_x"]))

which doesn't address the root cause where it persisted as float instead of int. so this may not be the desired solution.

chaosparrot commented 1 year ago

Thanks for reporting this - what OS was this new machine? I haven't seen this before on Windows or Linux myself namely, but I can see if I can cast to ints before persisting as well.

chaosparrot commented 1 year ago

I fixed the persistence in the latest master branch - That will mean that if you have a preference file with floats still in them, you might have to manually edit it or remove the file after updating to make sure it doesn't crash.