fourshade / spectra_lexer

Stroke and rule analyzer for stenography
GNU General Public License v2.0
35 stars 3 forks source link

Spectra lexer uses the wrong configuration #5

Closed benoit-pierre closed 3 years ago

benoit-pierre commented 3 years ago

I'm on Windows, I have created an empty plover.cfg file beside the executable to run in portable mode, yet Spectra Lexer is trying to parse an invalid configuration file somewhere in ~/AppData/Local/plover/plover/plover.cfg. Why are you re-implementing appdirs? Why are you re-implementing Plover's code for locating the config file?

fourshade commented 3 years ago

The only reason it looks for Plover's configuration is to find the user's dictionary files if not running as a plugin. If Plover calls it as a plugin, it doesn't need it at all, but it looks like the current code path has it attempting the file access anyway and ignoring whatever happens. Not harmful, but not efficient either; I can probably prune this on the next refactoring pass.

IMHO, what appdirs does is too simple to justify an external package dependency. I have a relatively high bar for this since I've had so many headaches dealing with the Python packaging system and transitive dependencies built like a house of cards.

fourshade commented 3 years ago

The newest version should no longer search for this file in plugin mode.