commit/StationPlaylist: 2 new changesets

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Wed, 15 Jul 2015 20:48:29 -0000

2 new commits in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/ffb095c604d6/
Changeset: ffb095c604d6
Branch: None
User: josephsl
Date: 2015-07-15 20:46:38+00:00
Summary: 5.2: Slightly faster carts reader when Studio standard is in use.

In Studio 5.00 and later, the edition of Studio is displayed as part of the
title bar of the plalist viewer. Thus use this to force carts reader to work
with only function key carts. This should speed up carts reader for those using
SPL Standard.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/__init__.py
b/addon/appModules/splstudio/__init__.py
index f958940..5f3a970 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -854,16 +854,20 @@ class AppModule(appModuleHandler.AppModule):
else: cart = "%s+%s"%(modifier, identifier)
self.carts[cart] = cartName

- def cartsReader(self):
+ def cartsReader(self, standardEdition=False):
# Use cart files in SPL's data folder to build carts dictionary.
# use a combination of SPL user name and static cart location
to locate cart bank files.
# Once the cart banks are located, use the routines in the
populate method below to assign carts.
# Todo: refactor this function by splitting it into several
functions.
- def _populateCarts(c, modifier):
+ # Since sstandard edition does not support number row carts,
skip them if told to do so.
+ def _populateCarts(c, modifier, standardEdition=False):
# The real cart string parser, a helper for cart
explorer for building cart entries.
cartlst = c.split("\",\"") # c = cart text.
# Get rid of unneeded quotes in cart entries.
- cartlst[0], cartlst[-1] = cartlst[0][1:],
cartlst[-1][:-1]
+ cartlst[0] = cartlst[0][1:]
+ # 5.2: Discard number row if SPL Standard is in use.
+ if standardEdition: cartlst = cartlst[:12]
+ else: cartlst[-1] = cartlst[-1][:-1]
n = 0 # To keep track of how many entries were
processed, also used to detect license type.
for i in cartlst:
n+=1
@@ -898,7 +902,7 @@ class AppModule(appModuleHandler.AppModule):
with open(cartFile) as cartInfo:
cl = cartInfo.readlines() # cl = cart list.
preprocessedCarts = cl[1].strip() # Ignore the empty
line (again be careful if the cart file format changes in a future release).
- cartCount += _populateCarts(preprocessedCarts, mod) #
See the comment for _populate method above.
+ cartCount += _populateCarts(preprocessedCarts, mod,
standardEdition=standardEdition) # See the comment for _populate method above.
return cartReadSuccess, cartCount

def script_toggleCartExplorer(self, gesture):
@@ -910,7 +914,7 @@ class AppModule(appModuleHandler.AppModule):
# Translators: Presented when cart explorer
cannot be entered.
ui.message(_("You are not in playlist viewer,
cannot enter cart explorer"))
return
- cartsRead, cartCount = self.cartsReader()
+ cartsRead, cartCount =
self.cartsReader(standardEdition=fg.name.startswith("StationPlaylist Studio
standard"))
if not cartsRead:
# Translators: presented when cart explorer
could not be switched on.
ui.message(_("Some or all carts could not be
assigned, cannot enter cart explorer"))


https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/e1933d8941ea/
Changeset: e1933d8941ea
Branch: master
User: josephsl
Date: 2015-07-15 20:48:14+00:00
Summary: Cart Explorer R2 (6.0-dev): Detect if SPL Standard is active by
looking of the title bar.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/__init__.py
b/addon/appModules/splstudio/__init__.py
index e029a22..69da9cb 100755
--- a/addon/appModules/splstudio/__init__.py
+++ b/addon/appModules/splstudio/__init__.py
@@ -865,16 +865,20 @@ class AppModule(appModuleHandler.AppModule):
else: cart = "%s+%s"%(modifier, identifier)
self.carts[cart] = cartName

- def cartsReader(self):
+ def cartsReader(self, standardEdition=False):
# Use cart files in SPL's data folder to build carts dictionary.
# use a combination of SPL user name and static cart location
to locate cart bank files.
# Once the cart banks are located, use the routines in the
populate method below to assign carts.
# Todo: refactor this function by splitting it into several
functions.
- def _populateCarts(c, modifier):
+ # Since sstandard edition does not support number row carts,
skip them if told to do so.
+ def _populateCarts(c, modifier, standardEdition=False):
# The real cart string parser, a helper for cart
explorer for building cart entries.
cartlst = c.split("\",\"") # c = cart text.
# Get rid of unneeded quotes in cart entries.
- cartlst[0], cartlst[-1] = cartlst[0][1:],
cartlst[-1][:-1]
+ cartlst[0] = cartlst[0][1:]
+ # 5.2: Discard number row if SPL Standard is in use.
+ if standardEdition: cartlst = cartlst[:12]
+ else: cartlst[-1] = cartlst[-1][:-1]
n = 0 # To keep track of how many entries were
processed, also used to detect license type.
for i in cartlst:
n+=1
@@ -909,7 +913,7 @@ class AppModule(appModuleHandler.AppModule):
with open(cartFile) as cartInfo:
cl = cartInfo.readlines() # cl = cart list.
preprocessedCarts = cl[1].strip() # Ignore the empty
line (again be careful if the cart file format changes in a future release).
- cartCount += _populateCarts(preprocessedCarts, mod) #
See the comment for _populate method above.
+ cartCount += _populateCarts(preprocessedCarts, mod,
standardEdition=standardEdition) # See the comment for _populate method above.
return cartReadSuccess, cartCount

def script_toggleCartExplorer(self, gesture):
@@ -921,7 +925,7 @@ class AppModule(appModuleHandler.AppModule):
# Translators: Presented when cart explorer
cannot be entered.
ui.message(_("You are not in playlist viewer,
cannot enter cart explorer"))
return
- cartsRead, cartCount = self.cartsReader()
+ cartsRead, cartCount =
self.cartsReader(standardEdition=fg.name.startswith("StationPlaylist Studio
standard"))
if not cartsRead:
# Translators: presented when cart explorer
could not be switched on.
ui.message(_("Some or all carts could not be
assigned, cannot enter cart explorer"))

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: