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
Send current synthDriver name and brailleDisplay name to update server for stats gathering. #8217
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
06a93fb
Send current synthDriver name and brailleDisplay name to update serve…
michaelDCurran 294bb1b
When sending synth / braille driver names to the server for stats gat…
michaelDCurran f303ca6
Ask the user if they wish to allow sending usage data to NV Access. …
michaelDCurran f8d0c48
Address review actions
michaelDCurran c40db2e
Fix typo
michaelDCurran 65dabee
Implement new AllowUsageStats dialog with yes, no, and ask later butt…
michaelDCurran da91a7e
Address review actions.
michaelDCurran 50beb08
Add comment
michaelDCurran 8d78b01
Move allow usage stats checkbox to the end of General Settings.
michaelDCurran 3dc51c1
Merge branch 'master' into synthBrailleStats
michaelDCurran File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
|
||
import winVersion | ||
import os | ||
import inspect | ||
import threading | ||
import time | ||
import cPickle | ||
|
@@ -30,9 +31,12 @@ | |
import ssl | ||
import wx | ||
import languageHandler | ||
import speech | ||
import braille | ||
import gui | ||
from gui import guiHelper | ||
from logHandler import log | ||
from addonHandler import getCodeAddon, AddonError | ||
from logHandler import log, isPathExternalToNVDA | ||
import config | ||
import shellapi | ||
import winUser | ||
|
@@ -62,6 +66,26 @@ | |
#: C{None} if it is disabled. | ||
autoChecker = None | ||
|
||
def getQualifiedDriverClassNameForStats(cls): | ||
""" fetches the name from a given synthDriver or brailleDisplay class, and appends core for in-built code, the add-on name for code from an add-on, or external for code in the NVDA user profile. | ||
Some examples: | ||
espeak (core) | ||
newfon (external) | ||
eloquence (addon:CodeFactory) | ||
noBraille (core) | ||
""" | ||
name=cls.name | ||
try: | ||
addon=getCodeAddon(cls) | ||
except AddonError: | ||
addon=None | ||
if addon: | ||
return "%s (addon:%s)"%(name,addon.name) | ||
path=inspect.getsourcefile(cls) | ||
if isPathExternalToNVDA(path): | ||
return "%s (external)"%name | ||
return "%s (core)"%name | ||
|
||
def checkForUpdate(auto=False): | ||
"""Check for an updated version of NVDA. | ||
This will block, so it generally shouldn't be called from the main thread. | ||
|
@@ -71,15 +95,28 @@ def checkForUpdate(auto=False): | |
@rtype: dict | ||
@raise RuntimeError: If there is an error checking for an update. | ||
""" | ||
allowUsageStats=config.conf["update"]['allowUsageStats'] | ||
params = { | ||
"autoCheck": auto, | ||
"allowUsageStats":allowUsageStats, | ||
"version": versionInfo.version, | ||
"versionType": versionInfo.updateVersionType, | ||
"osVersion": winVersion.winVersionText, | ||
"x64": os.environ.get("PROCESSOR_ARCHITEW6432") == "AMD64", | ||
"language": languageHandler.getLanguage(), | ||
"installed": config.isInstalledCopy(), | ||
} | ||
if auto and allowUsageStats: | ||
synthDriverClass=speech.getSynth().__class__ | ||
brailleDisplayClass=braille.handler.display.__class__ if braille.handler else None | ||
# Following are parameters sent purely for stats gathering. | ||
# If new parameters are added here, they must be documented in the userGuide for transparency. | ||
extraParams={ | ||
"language": languageHandler.getLanguage(), | ||
"installed": config.isInstalledCopy(), | ||
"synthDriver":getQualifiedDriverClassNameForStats(synthDriverClass) if synthDriverClass else None, | ||
"brailleDisplay":getQualifiedDriverClassNameForStats(brailleDisplayClass) if brailleDisplayClass else None, | ||
"outputBrailleTable":config.conf['braille']['translationTable'] if brailleDisplayClass else None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be worth while adding a comment here to say that any additions must be added to the userguide. |
||
} | ||
params.update(extraParams) | ||
url = "%s?%s" % (CHECK_URL, urllib.urlencode(params)) | ||
try: | ||
res = urllib.urlopen(url) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm surprised that you don't need to call
EndModal
here? Could it be because of theevt.Skip()
?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.
Why are you calling
Skip()
on this?