Closed lah7 closed 8 years ago
Ok cool, I take it you tested this thoroughly
... just saying ;)
... just saying ;)
I did my best, mistakes happen, time is limited. I find that remark slightly disrespectful. :unamused:
Since commit 917d74e6274801ce77a7c985bc8bcea2ef26c7b0, data had switched from being stored as a boolean to a string, due to how JSON is being read/saved and passed around. We'll need to be careful of that.
917d74e6274801ce77a7c985bc8bcea2ef26c7b0 Preferences with booleans now back to using strings for best compatibility with JavaScript.
No disrespect was intended.
Since commit 917d74e, data had switched from being stored as a boolean to a string, due to how JSON is being read/saved and passed around
Why can't we use normal booleans? Json.loads() will convert 'true' -> True automatically, etc...
Originally, that was the plan, and setting index[test] = True
would save as a boolean true
to JSON (not 'true'
). Due to how these on/off states get passed around, in some places they end up as a string (possibly JS → Python and/or via Python → JS execute_script
), so it was easier to cut corners and simply use strings throughout. JavaScript's true
and Python's True
introduce some problems.
The preferences module (and commands?) would need additional code / checks for converting booleans if desired later, but I see little gain at this point. It works fine as strings, even if that's not the correct way to do it.
Ahh, yes if JS ↔ Python is going on then that would make sense. Ideally it would be nice to convert back to True
but as you said it is little gain at the moment, just would of been nice is all ;).
We can always go through and refactor things later.
My bad. This fix is for my last set of changes (#90) by correcting the start-up code for the tray - which automatically turned macro settings on, due to my misunderstanding of
bool()
(which was always returning true).I wondered why the hot keys and sleep key stopped working, that happens when macro keys are activated.