dictation-toolbox / natlinkcore

Other
4 stars 5 forks source link

Loader falls back to default config if there is not a file to load #15

Open LexiconCode opened 2 years ago

LexiconCode commented 2 years ago

Loader falls back to default config if not a a file (_a-grammer.py) to load despite a user dir path being set in a existing config.

Reproduce

  1. Use latest master
  2. Use natlinkconfig_gui.py to set dragonfly user directory
  3. Check in the dragonfly user directory making sure it does not have any file prefixed with '_' for the loader to load.
  4. Start Dragon and see issue image
    • Note: To test use a blank file '_test.py' in the dragonfly user directory. Then the loader behaves as expected using existing config.
quintijn commented 2 years ago

Yes, this is not right. But if you drop one valid grammar file in that directory, it will work. (eg from the (path/to/clone/of/natlinkcore)\src\natlinkcore\SampleMacros\OriginalSampleMacros)

I will think about a fix...

quintijn commented 2 years ago

Sorry I did not mention:

Now, when no natlink.ini file, or an empty natlink.ini file, there is a message at startup, but no fallback to the default.

Instead, the user is urged to run the config program natlinkconfig_gui.py.

Possibly emptying deliberately natlink.ini will give a better message than now, AND give all the fallback info. Which should be updated once more. I paid much attention to it before, but I should go through this again.

quintijn commented 2 years ago

So: for a pre release, the info is short and clear. For debugging things when all goes wrong, we possibly need the complete fallback information...

quintijn commented 2 years ago

Now, intermediate, when no natlink.ini is found, or no grammars are present, a short message is shown, referring to the config program. It is not nice to show all the fallback info when you forget to configure natlink before starting Dragon. Gives too much confusion for (new) users...

What should be done, is review long fallback info, and show this only when the file natlink.ini is (deliberately) made empty. Unless there are better ideas for this, to trigger.

I will work on this...