commit/StationPlaylist: 2 new changesets

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Wed, 15 Jul 2015 02:33:36 -0000

2 new commits in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/c1e5658091e0/
Changeset: c1e5658091e0
Branch: None
User: josephsl
Date: 2015-07-15 02:31:00+00:00
Summary: Selective column announcemnet (6.0-dev): Handle several errors
when parsing column order.

Column announcement must have:
* Length of 6.
* Must contain names of columns.
If not, NVDA will log this as validation error and will log it accordingly.
Also, errors is now a dictionary.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 414f2fa..9370374 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -61,11 +61,13 @@ def resetConfig(defaults, activeConfig, intentional=False):
# Translators: Title of the reset config dialog.
_("Reset configuration"), wx.OK|wx.ICON_INFORMATION)

-# In case one or more profiles had config issues, look up the error message
form the following map.
-_configErrors = (
- ("All settings reset to defaults"),
- ("Some settings reset to defaults")
-)
+# In case one or more profiles had config issues, look up the error message
from the following map.
+_configErrors ={
+ "completeReset":"All settings reset to defaults",
+ "partialReset":"Some settings reset to defaults",
+ "columnOrderReset":"Column announcement order reset to defaults",
+ "partialAndColumnOrderReset":"Some settings, including column
announcement order reset to defaults"
+}

# To be run in app module constructor.
# With the load function below, load the config upon request.
@@ -112,21 +114,34 @@ def unlockConfig(path, profileName=None, prefill=False):
if not configTest:
# Case 1: restore settings to defaults when 5.x config
validation has failed on all values.
resetConfig(SPLDefaults, SPLConfigCheckpoint)
- _configLoadStatus[profileName] = 0
+ _configLoadStatus[profileName] = "completeReset"
elif isinstance(configTest, dict):
# Case 2: For 5.x and later, attempt to reconstruct the
failed values.
for setting in configTest:
if not configTest[setting]:
SPLConfigCheckpoint[setting] =
SPLDefaults[setting]
SPLConfigCheckpoint.write()
- _configLoadStatus[profileName] = 1
- _extraInitSteps(SPLConfigCheckpoint)
+ _configLoadStatus[profileName] = "partialReset"
+ _extraInitSteps(SPLConfigCheckpoint, profileName)
SPLConfigCheckpoint.name = profileName
return SPLConfigCheckpoint

# Extra initialization steps such as converting value types.
-def _extraInitSteps(conf):
- conf["ColumnOrder"] = conf["ColumnOrder"].split(",")
+def _extraInitSteps(conf, profileName=None):
+ global _configLoadStatus
+ columnOrder = conf["ColumnOrder"].split(",")
+ # Catch suttle errors.
+ fields = ["Artist","Title","Duration","Intro","Category","Filename"]
+ invalidFields = 0
+ for field in fields:
+ if field not in columnOrder: invalidFields+=1
+ if invalidFields or len(columnOrder) != 6:
+ if profileName in _configLoadStatus and
_configLoadStatus[profileName] == "partialReset":
+ _configLoadStatus[profileName] =
"partialAndColumnOrderReset"
+ else:
+ _configLoadStatus[profileName] = "columnOrderReset"
+ columnOrder = fields
+ conf["ColumnOrder"] = columnOrder
conf["IncludedColumns"] = set(conf["IncludedColumns"].split(","))

# Perform some extra work before writing the config file.


https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/bba9344bb9f2/
Changeset: bba9344bb9f2
Branch: 6.0/selectiveColumnAnnouncements
User: josephsl
Date: 2015-07-15 02:33:05+00:00
Summary: Properly pass in profile name as a kwarg.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 9370374..7da4972 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -122,7 +122,7 @@ def unlockConfig(path, profileName=None, prefill=False):
SPLConfigCheckpoint[setting] =
SPLDefaults[setting]
SPLConfigCheckpoint.write()
_configLoadStatus[profileName] = "partialReset"
- _extraInitSteps(SPLConfigCheckpoint, profileName)
+ _extraInitSteps(SPLConfigCheckpoint, profileName=profileName)
SPLConfigCheckpoint.name = profileName
return SPLConfigCheckpoint

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: