Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorRafael Ortiz <rafael@activitycentral.com>2012-02-16 20:36:40 (GMT)
committer Rafael Ortiz <rafael@activitycentral.com>2012-02-16 20:36:40 (GMT)
commit150c58b697c920922d2a7b3dfaa4c056973f4726 (patch)
treea8aa232435afa1221a5663933e10d58212d44c11 /library
parent8cd13c5f1425680d45efb057d178b855847e1622 (diff)
Not harcoding tamtam-edit path
Diffstat (limited to 'library')
-rwxr-xr-xlibrary/pippy/sound.py61
1 files changed, 30 insertions, 31 deletions
diff --git a/library/pippy/sound.py b/library/pippy/sound.py
index 24074cf..86e5651 100755
--- a/library/pippy/sound.py
+++ b/library/pippy/sound.py
@@ -1,7 +1,5 @@
-#! /usr/bin/env python
# Copyright (C) 2007,2008 One Laptop per Child Association, Inc.
#
-# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
@@ -18,38 +16,39 @@ import errno
import os
import sys
import sugar.env
-from sugar.activity import registry
from gettext import gettext as _
-
-
-#Retrieve and ActivityRegistry Object
-ar = registry.get_registry()
-# search for activities with name 'pippy'
-aiList = ar.find_activity('pippy')
-# for each ActivityInfo object (representing each activity) found, print out the activity name.
-for ai in aiList:
- print ai.path
-
-#tp= '/TamTamEdit.activity/'
-tp = ai.path
-tamtam_subdir = str(os.path.join(tp, 'common', 'Resources', 'Sounds'))
-
-sound_candidate_dirs = [
- os.path.expandvars('$SUGAR_PATH/activities') + tamtam_subdir,
- sugar.env.get_user_activities_path() + tamtam_subdir,
-]
-
-orchlines = []
-scorelines = []
-instrlist = []
-fnum = [100]
-
+from sugar.activity import activity
+
+path = activity.get_bundle_path()
+path = path.split("/" )[0:-1]
+path = "/".join(path)
+
+#ff = open("/tmp/rafael.txt", "a")
+ff.write(path + "\n")
+for f in os.listdir(path):
+ #ff.write(f + "\n")
+
+ if f == 'TamTamEdit.activity':
+ bundle_dir = os.path.join(path, f)
+ tamtam_subdir = str(os.path.join(bundle_dir, 'common', 'Resources', 'Sounds'))
+ sound_candidate_dirs = [
+ os.path.expandvars('$SUGAR_PATH/activities') + tamtam_subdir,
+ #sugar.env.get_user_activities_path() + tamtam_subdir
+ tamtam_subdir
+ ]
+ ff.write(str(sound_candidate_dirs) + "\n")
+ orchlines = []
+ scorelines = []
+ instrlist = []
+ fnum = [100]
+
+ff.close()
"""XXX: This function seems to be broken. (CSA)
def quit(self):
- perf.Stop()
- perf.Join()
- cs.Reset()
- cs = None
+perf.Stop()
+perf.Join()
+cs.Reset()
+cs = None
"""