-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect alternate drive DNS install locations and versions #242 #243
Conversation
…arches across all drives DNS root folder. dictation-toolbox#242
caster/lib/settings.py
Outdated
if os.path.isfile(ExePath): | ||
return ExePath | ||
else: | ||
print ' Dragon Naturally Speaking' + str(Version) + ' is not supported by Castor. Only versions 13 and above are supported. Purchase Dragon Naturally Speaking 13 or above' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caster.
@masisley Nice catch, thanks for reviewing! Because we use I'll add a create something like |
This should be feature complete and robust. Your feedback would be appreciated! There are at least two ways you can help test.
|
Will tested by tomorrow and report. |
So:
the engine path gets set to empty string. Restarting Dragon fixes this, the proper path is found and set,but the reboot command doesn't work until the path is set because it depends on it (extremely annoying). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes should fix the engine path being replaced by empty string.
@@ -71,7 +106,7 @@ def _find_natspeak(): | |||
# EXECUTABLES | |||
"DEFAULT_BROWSER_PATH": "C:/Program Files (x86)/Mozilla Firefox/firefox.exe", | |||
"DOUGLAS_PATH": BASE_PATH + "/asynch/mouse/grids.py", | |||
"ENGINE_PATH": _find_natspeak(), | |||
"ENGINE_PATH": _validate_natspeak(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validate should return the exe path , instead it returns empty string as noted in the other comment.
caster/lib/settings.py
Outdated
print "Setting DNS path to " + exe_path | ||
except Exception as e: | ||
print "Error saving json file " + str(e) + _SETTINGS_PATH | ||
return "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The functions should always return exe_path so that empty string is not set as the default engine path.
I appreciate the feedback! Showing my ignorance here. What were the steps to reproduce this?
My intent was the only condition when an empty string is set when An empty string In addition, could you upload Edit:
I can understand In your I think in the scenario you described
In that case From my understanding which is very limited and You can simulate this by changing settings.py deleting |
Destroy the path and reboot: The full error message because I missed an important line:
The reboot Dragon command opens a file Explorer window to the correct path but doesn't actually run NatSpeak.exe. This could be unrelated to your additions so it could be ignored if the latter problem is fixed. After restarting Dragon again:
to see what happens in the first case with the loading, I put the _save call from the _init function in a comment. Your function somehow adds extra curly braces to the json file. This is why it fails to load and instead loads the default values which had the engine path set as empty string. The settings file is generated again so everything works after that. |
Thanks for explaining. So to reproduce
I can't reproduce the error. Can you reproduce it by?
|
As for
Castor initializes loading Check out |
I first deleted settings.json, rebooted and then destroyed the path and rebooted again. |
This could be something wonky but what seems to fix the problem is to use a "w" flag instead of "r+" when you open settings.json inside validate_NatSpeak. Instead of truncating the file and then writing it ,you are writing over existing characters.Since your new configuration is actually a smaller file than the one I create with extra noise in the path ,some extra brackets remain in the end. After testing with longer noise text, this seems to be the case as the extra characters end up in other positions. |
Thank you for taking the time to test. Feels like I'm banging my head against a brick wall. Fortunately it makes sense why I can't reproduce it up till now. My bad assumption was I thought it was overwriting the file. I really do dislike working with I'm still flummoxed by the idea I can't reproduce it using. The default settings should be the same file size in terms lines of code.
Regardless I believe you hit the nail on the head though with the root of the problem. I'll include |
Hopefully this is resolved and let me know. Thanks for your time to review and test! |
Seems to work great now! |
The premise is the search for DNS across all drives and to check DNS version.