dictation-toolbox/natlinkcore

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

LexiconCode opened this issue · 4 comments

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.

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...

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.

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...

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...