commit/StationPlaylist: josephsl: 6.3: Remove unnecessary statements, catch exception when attempting to rename profiles.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Wed, 20 Jan 2016 23:22:55 -0000

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/3620e8aeba17/
Changeset:   3620e8aeba17
Branch:      6.x
User:        josephsl
Date:        2016-01-20 23:22:28+00:00
Summary:     6.3: Remove unnecessary statements, catch exception when 
attempting to rename profiles.

When attempting to rename a profile and if the file path does not exist, 
Windows will throw an error. Previsouly this check wasn't done, which caused 
renamed string to fail to show up (a major bug).
Also removed unnecessary statements including a print statement from 6.0.
This is destined for add-on 6.3 and later.

Affected #:  1 file

diff --git a/addon/appModules/splstudio/splconfig.py 
b/addon/appModules/splstudio/splconfig.py
index 514d9b6..20355c3 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -772,7 +772,6 @@ class SPLConfigDialog(gui.SettingsDialog):
                self.columnOrder = curProfile["ColumnOrder"]
                # 6.1: Again convert list to set.
                self.includedColumns = set(curProfile["IncludedColumns"])
-               print self.metadataStreams
 
        # Profile controls.
        # Rename and delete events come from GUI/config profiles dialog from 
NVDA core.
@@ -807,7 +806,10 @@ class SPLConfigDialog(gui.SettingsDialog):
                        return
                oldNamePath = oldName + ".ini"
                oldProfile = os.path.join(SPLProfiles, oldNamePath)
-               os.rename(oldProfile, newProfile)
+               try:
+                       os.rename(oldProfile, newProfile)
+               except WindowsError:
+                       pass
                if self.switchProfile == oldName:
                        self.switchProfile = newName
                        self.switchProfileRenamed = True
@@ -843,7 +845,6 @@ class SPLConfigDialog(gui.SettingsDialog):
                        SPLPrevProfile = None
                        self.switchProfileDeleted = True
                self.profiles.Delete(index)
-               self.profiles.SetString(0, SPLConfigPool[0].name)
                # 6.3: Select normal profile if the active profile is gone.
                try:
                        self.profiles.Selection = 
self.profiles.Items.index(self.activeProfile)

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: 6.3: Remove unnecessary statements, catch exception when attempting to rename profiles. - commits-noreply