commit/StationPlaylist: josephsl: Broadcast profiles (6.0-dev): When creating a brand new profile, try creating an empty ini file.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Mon, 06 Jul 2015 22:52:00 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/9162ecfa0c88/
Changeset: 9162ecfa0c88
Branch: master
User: josephsl
Date: 2015-07-06 22:51:40+00:00
Summary: Broadcast profiles (6.0-dev): When creating a brand new profile,
try creating an empty ini file.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index b1b58e3..229cdca 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -72,7 +72,7 @@ def initConfig():
# Load the default config from a list of profiles.
global SPLConfig, SPLConfigPool, _configLoadStatus
if SPLConfigPool is None: SPLConfigPool = []
- SPLConfigPool.append(unlockConfig(SPLIni, profileName="Normal profile"))
+ SPLConfigPool.append(unlockConfig(SPLIni, profileName="Normal profile",
prefill=True))
try:
profiles = filter(lambda fn: os.path.splitext(fn)[-1] ==
".ini", os.listdir(SPLProfiles))
for profile in profiles:
@@ -92,12 +92,12 @@ def initConfig():
runConfigErrorDialog("\n".join(messages), title)

# 6.0: Unlock (load) profiles from files.
-def unlockConfig(path, profileName=None):
+def unlockConfig(path, profileName=None, prefill=False):
global _configLoadStatus # To be mutated only during unlock routine.
SPLConfigCheckpoint = ConfigObj(path, configspec = confspec,
encoding="UTF-8")
# 5.2 and later: check to make sure all values are correct.
val = Validator()
- configTest = SPLConfigCheckpoint.validate(val, copy=True)
+ configTest = SPLConfigCheckpoint.validate(val, copy=prefill)
if configTest != True:
# Hack: have a dummy config obj handy just for storing default
values.
SPLDefaults = ConfigObj(None, configspec = confspec,
encoding="UTF-8")
@@ -412,7 +412,10 @@ class SPLConfigDialog(gui.SettingsDialog):
name = SPLConfigPool[index].name
path = SPLConfigPool[index].filename
del SPLConfigPool[index]
- os.remove(path)
+ try:
+ os.remove(path)
+ except WindowsError:
+ pass
self.profiles.Delete(index)
self.profiles.SetString(0, SPLConfigPool[0].name)
self.profiles.Selection = 0

Repository URL: https://bitbucket.org/nvdaaddonteam/stationplaylist/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.

Other related posts:

  • » commit/StationPlaylist: josephsl: Broadcast profiles (6.0-dev): When creating a brand new profile, try creating an empty ini file. - commits-noreply