commit/StationPlaylist: josephsl: Merge branch '5.2' into stable

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Tue, 07 Jul 2015 20:28:27 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/1f59656628c5/
Changeset: 1f59656628c5
Branch: stable
User: josephsl
Date: 2015-07-07 20:27:51+00:00
Summary: Merge branch '5.2' into stable

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index ebb75a2..f68f492 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -33,36 +33,6 @@ SayPlayingCartName = boolean(default=true)
confspec.newlines = "\r\n"
SPLConfig = None

-# List of values to be converted manually.
-# This will be called only once: when upgrading from prior versions to 5.0, to
be removed in 5.1.
-configConversions=("EndOfTrackTime", "SongRampTime")
-
-# The accompanying function for config conversion.
-# Returns config=false if errors occur, to be checked in the app module
constructor.
-def config4to5(config):
- migrationFailure = 0
- for setting in configConversions:
- try:
- oldValue = str(config[setting])
- except KeyError:
- continue
- if oldValue.isdigit():
- continue
- # If the old value doesn't conform to below conditions, start
from a fresh config spec.
- try:
- if (len(oldValue) == 5
- and oldValue.startswith("00:")
- and oldValue.split(":")[1].isdigit()):
- newValue = config[setting].split(":")[1]
- config[setting] = int(newValue)
- else:
- migrationFailure+=1
- continue
- except IndexError, ValueError:
- migrationFailure += 1
- continue
- return True if not migrationFailure else False
-
# Display an error dialog when configuration validation fails.
def runConfigErrorDialog(errorText, errorType):
wx.CallAfter(gui.messageBox, errorText, errorType, wx.OK|wx.ICON_ERROR)
@@ -91,9 +61,7 @@ def initConfig():
# 6.0: Unlock (load) profiles from files.
def unlockConfig(path):
SPLConfigCheckpoint = ConfigObj(path, configspec = confspec,
encoding="UTF-8")
- # 5.0 only: migrate 4.x format to 5.0, to be removed in 5.1.
- migrated = config4to5(SPLConfigCheckpoint)
- # 5.1 and later: check to make sure all values are correct.
+ # 5.2 and later: check to make sure all values are correct.
val = Validator()
configTest = SPLConfigCheckpoint.validate(val, copy=True)
if configTest != True:
@@ -102,9 +70,8 @@ def unlockConfig(path):
SPLDefaults.validate(val, copy=True)
# Translators: Standard error title for configuration error.
title = _("Studio add-on Configuration error")
- if not configTest or not migrated:
- # Case 1: restore settings to defaults.
- # This may happen when 4.x config had parsing issues or
5.x config validation has failed on all values.
+ if not configTest:
+ # Case 1: restore settings to defaults when 5.x config
validation has failed on all values.
resetConfig(SPLDefaults, SPLConfigCheckpoint)
# Translators: Standard dialog message when Studio
configuration has problems and was reset to defaults.
errorMessage = _("Your Studio add-on configuration has
errors and was reset to factory defaults.")

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: Merge branch '5.2' into stable - commits-noreply