Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pippy_app.py
diff options
context:
space:
mode:
authorWalter Bender <walter@sugarlabs.org>2014-02-04 21:06:57 (GMT)
committer Walter Bender <walter@sugarlabs.org>2014-02-04 21:06:57 (GMT)
commitdbd7908aaf2c0ad38dbe4ea9415d720cf8190452 (patch)
tree44b45e4b7c5f1897c3478509c25bc4ae634e7b68 /pippy_app.py
parentd543dbd3c1a761876efda2220345117e1aefd624 (diff)
fix several issues with sound: workaround for import sugar3.activity error; don't load sound examples if tamtam suite is not installed
Diffstat (limited to 'pippy_app.py')
-rw-r--r--pippy_app.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/pippy_app.py b/pippy_app.py
index 4ceb6a1..a35b175 100644
--- a/pippy_app.py
+++ b/pippy_app.py
@@ -75,6 +75,7 @@ import groupthink.gtk_tools
from filedialog import FileDialog
from icondialog import IconDialog
+import sound_check
text_buffer = None
# magic prefix to use utf-8 source encoding
@@ -265,13 +266,19 @@ class PippyActivity(ViewSourceActivity, groupthink.sugar_tools.GroupActivity):
stop = StopButton(self)
self.get_toolbar_box().toolbar.insert(stop, -1)
- self.paths = []
-
vpane = Gtk.Paned.new(orientation=Gtk.Orientation.VERTICAL)
vpane.set_position(400) # setting initial position
self.paths = []
+ try:
+ if sound_check.finddir():
+ TAMTAM_AVAILABLE = True
+ else:
+ TAMTAM_AVAILABLE = False
+ except sound_check.SoundLibraryNotFoundError:
+ TAMTAM_AVAILABLE = False
+
data_path = os.path.join(get_bundle_path(), 'data')
# get default language from locale
@@ -300,6 +307,10 @@ class PippyActivity(ViewSourceActivity, groupthink.sugar_tools.GroupActivity):
self.all_folders.append(d)
for folder in self.all_folders:
+ # Skip sound folders if TAMTAM is not installed
+ if folder == 'sound' and not TAMTAM_AVAILABLE:
+ continue
+
direntry = {}
# check if dir exists in pref language, if exists, add it
if os.path.exists(os.path.join(lang_path, folder)):