[nvda-addons] Re: commit/StationPlaylist: josephsl: Project Starfish (6.0-dev): The starfish is born, ready to spread its arms

  • From: "Brian's Mail list account BY" <bglists@xxxxxxxxxxxxxxxx>
  • To: <nvda-addons@xxxxxxxxxxxxx>
  • Date: Mon, 1 Jun 2015 09:22:10 +0100

OK why starfish?
I don't know much about them, but I guess they must lay eggs. Most of those I've seen are stuck to the inside of aquaria.
Brian

bglists@xxxxxxxxxxxxxxxx
Sent via blueyonder.
Please address personal email to:-
briang1@xxxxxxxxxxxxxxxx, putting 'Brian Gaff'
in the display name field.
----- Original Message ----- From: "Joseph Lee" <joseph.lee22590@xxxxxxxxx>
To: <nvda-addons@xxxxxxxxxxxxx>
Sent: Sunday, May 31, 2015 11:41 PM
Subject: [nvda-addons] Re: commit/StationPlaylist: josephsl: Project Starfish (6.0-dev): The starfish is born, ready to spread its arms


Hi all, mostly StationPlaylist Studio users:
It's an unusual subject line indeed: Project Starfish refers to a feature
that'll be available in the next major version of SPL add-on, something no
other screen reader scripts for SPL have. In short, with Project Starfish,
you'll be able to tell "starfish arms" to change how NVDA behaves in Studio
in specific situations. To give you a hint, imagine what happens if you
define a configuration profile for say all where NVDA can read using a
different synthesizer.
I'll demonstrate this project in July 2015 when we have our user chat for
SPL add-on. Until then, this starfish will not hatch from its egg.
Cheers,
Joseph
P.S. Yes, Project Starfish does refer to a feature that NvDA scripts will
have that other screen readers for SPL doesn't have.

-----Original Message-----
From: nvda-addons-commits-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-commits-bounce@xxxxxxxxxxxxx] On Behalf Of
commits-noreply@xxxxxxxxxxxxx
Sent: Sunday, May 31, 2015 3:34 PM
To: nvda-addons-commits@xxxxxxxxxxxxx
Subject: commit/StationPlaylist: josephsl: Project Starfish (6.0-dev): The
starfish is born, ready to spread its arms

1 new commit in StationPlaylist:

https://bitbucket.org/nvdaaddonteam/stationplaylist/commits/6ae8c9917e34/
Changeset: 6ae8c9917e34
Branch: 6.0/broadcastProfile
User: josephsl
Date: 2015-05-31 22:33:51+00:00
Summary: Project Starfish (6.0-dev): The starfish is born, ready to
spread its arms

Laid the foundation for broadcast profile. Profiles will be stored in
profiles folder under add-on directory.
Specifically:
* Because the profiles folder will be deleted when a new version of the
add-on is installed, check if we have a temporary profiles folder used to
store backup copies.
* In normal operation, profiles will be fetched from profiles folder.
Unlock function now includes a new keyword argument specifying profile
name/label. Also, save function saves all profiles.
As this is a new feature (a significant one that is the inspiration behind
codename starfish), it'll be made available in 6.0-dev.

Affected #: 1 file

diff --git a/addon/appModules/splstudio/splconfig.py
b/addon/appModules/splstudio/splconfig.py
index 26b6415..304cce7 100755
--- a/addon/appModules/splstudio/splconfig.py
+++ b/addon/appModules/splstudio/splconfig.py
@@ -16,6 +16,7 @@ from winUser import user32

# Configuration management
SPLIni = os.path.join(globalVars.appArgs.configPath, "splstudio.ini")
+SPLProfiles = os.path.join(globalVars.appArgs.configPath, "addons",
+"stationPlaylist", "profiles")
confspec = ConfigObj(StringIO("""
BeepAnnounce = boolean(default=false)
SayEndOfTrack = boolean(default=true)
@@ -31,6 +32,8 @@ SayListenerCount = boolean(default=true) """),
encoding="UTF-8", list_values=False) confspec.newlines = "\r\n"
SPLConfig = None
+# A pool of broadcast profiles.
+SPLConfigPool = []

# 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.
@@ -82,13 +85,31 @@ def resetConfig(defaults, activeConfig,
intentional=False):
# With the load function below, load the config upon request.
# 6.0: The below init function is really a vehicle that traverses through
config profiles in a loop.
def initConfig():
- # Load the default config.
- # Todo (6.0: go through the config beltway, loading each config
along the way.
- global SPLConfig
- SPLConfig = unlockConfig(SPLIni)
+ # Is this the first time I'm seeing a profile?
+ if not os.path.exists(SPLProfiles):
+ tempProfiles = os.path.join(globalVars.appArgs.configPath,
"__SPLProfiles")
+ # Is this really an empty profile set?
+ if os.path.exists(tempProfiles):
+ # Import contents of installation (temp) profiles
directory to the real profiles folder.
+ import shutil
+ inis = filter(lambda fn: os.path.splitext(fn)[-1] ==
".ini", os.listdir(tempProfiles))
+ if len(inis):
+ os.mkdir(SPLProfiles)
+ for ini in inis:
+
shutil.copy2(os.path.join(tempProfiles, ini), SPLProfiles)
+ # Load the default config from a list of profiles.
+ global SPLConfig, SPLConfigPool
+ SPLConfigPool.append(unlockConfig(SPLIni, profileName="Normal
profile"))
+ try:
+ profiles = filter(lambda fn: os.path.splitext(fn)[-1] ==
".ini", os.listdir(SPLProfiles))
+ for profile in profiles:
+
SPLConfigPool.append(unlockConfig(os.path.join(SPLProfiles, profile),
profileName=os.path.splitext(profile)[0]))
+ except WindowsError:
+ pass
+ SPLConfig = SPLConfigPool[0]

# 6.0: Unlock (load) profiles from files.
-def unlockConfig(path):
+def unlockConfig(path, profileName=None):
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) @@ -119,15 +140,17 @@ def
unlockConfig(path):
runConfigErrorDialog(errorMessage, title)
except AttributeError:
pass
+ SPLConfigCheckpoint.name = profileName
return SPLConfigCheckpoint

# Save configuration database.
def saveConfig():
- # 5.0: Save the one and only SPL config database.
- # Todo for 6.0: save all config profiles.
- global SPLConfig
- if SPLConfig is not None: SPLConfig.write()
+ # Save all config profiles.
+ global SPLConfig, SPLConfigPool
+ for configuration in SPLConfigPool:
+ if configuration is not None: configuration.write()
SPLConfig = None
+ SPLConfigPool = None


# Configuration dialog.

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.

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting bugs.
Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe:
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

Other related posts: