Skip to content
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

Fixed several bugs #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions addon/globalPlugins/sharedComputer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
speakers = None

def _getBaseValue(key):
val1 = config.conf.profiles[0]["sharedComputer"].get(key)
try:
val1 = config.conf.profiles[0]["sharedComputer"].get(key)
except:
val1 = None
val2 = config.conf["sharedComputer"].get(key)
return int(val1) if val1 is not None else int(val2)

Expand Down Expand Up @@ -109,10 +112,10 @@ class AddonSettingsDialog(SettingsDialog):
# Translators: Title of a dialog.
title = _("Shared Computer Settings (F1 for Context Help)")
# Translators: title of the browsable help message
helpTitle = _(u"Help")
helpTitle = _("Help")
# Translators: advice on how to close the browsable help message
hint = _(u"Press escape to close this message.")
hint = u"<p>{}</p>".format(hint)
hint = _("Press escape to close this message.")
hint = "<p>{}</p>".format(hint)
lastFocus = None
helpDict = {}
with open(helpPath,'r') as helpFile:
Expand Down Expand Up @@ -157,11 +160,11 @@ def makeSettings(self, settingsSizer):
self.volumeList.Bind(wx.EVT_CHOICE, self.onChoice)
self.volumeLevel.Bind(wx.EVT_CHAR_HOOK, self.onKey)
for number, child in enumerate([self.activateList, self.volumeList, self.volumeLevel], 1):
self.helpDict[child.GetId()] = u'\n'.join((self.sections[0], self.sections[number], self.hint, self.sections[4]))
self.helpDict[child.GetId()] = '\n'.join((self.sections[0], self.sections[number], self.hint, self.sections[4]))
child.Bind(wx.EVT_HELP, self.onHelp)

def onDialogActivate(self, evt):
"Ensures that the current control will be the same after switching to another window and back"
""" Ensures that the current control will be the same after switching to another window and back """
# store focus when the user switches to another window
if not evt.GetActive():
self.lastFocus = self.FindFocus()
Expand Down Expand Up @@ -202,14 +205,14 @@ def postInit(self):
self.activateList.SetFocus()

def onOk(self,evt):
super(AddonSettingsDialog, self).onOk(evt)
config.conf["sharedComputer"]["numLockActivationChoice"] = self.activateList.Selection
# write only to the normal configuration
newSettings = {"sharedComputer": {
"volumeCorrectionChoice": self.volumeList.Selection,
"volumeLevel": self.volumeLevel.Value}}
config.conf._profileCache[None].update(newSettings)
config.conf.profiles[0].update(newSettings)
super(AddonSettingsDialog, self).onOk(evt)

# Audio Stuff
def getVolumeObject():
Expand Down
3 changes: 2 additions & 1 deletion addon/installTasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ def onInstall():
profile.pop("useSharedComputers")
except KeyError:
pass
conf.spec["sharedComputer"] = confspec
conf.spec["sharedComputer"] = confspec
conf.save()
2 changes: 1 addition & 1 deletion sconstruct
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def md2html(source, dest):
mdText = f.read()
for k, v in headerDic.iteritems():
mdText = mdText.replace(k, v, 1)
htmlText = markdown.markdown(mdText, ['markdown.extensions.extra'])
htmlText = markdown.markdown(mdText, extensions=['markdown.extensions.extra'])
with codecs.open(dest, "w", "utf-8") as f:
f.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n" +
Expand Down