Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2014-01-07 15:05:15 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-01-07 17:20:30 (GMT)
commite8df675c83882d89cc6fd275826cf3ca1dac9885 (patch)
tree6e2ed72c0dde65c2702a2fd1dc0706215556b215
parent3e07b9c7b099e3d014fa42bdad9453313a22c299 (diff)
Set audio path in art4apps games when restart
We want use the audio files in the art4apps directory, to not need copy them. Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
-rw-r--r--model.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/model.py b/model.py
index 427d15c..17d15c8 100644
--- a/model.py
+++ b/model.py
@@ -211,6 +211,12 @@ class Model(object):
self.data['origin'] = attributes['origin']
if self.data['origin'] == 'art4apps':
self.data['pathimg'] = ART4APPS_IMAGE_PATH
+ if 'language' in attributes:
+ language = attributes['language']
+ else:
+ language = 'en'
+ self.data['pathsnd'] = join(ART4APPS_AUDIO_PATH,
+ language)
idpair = 0
for elem in memorize_elem.getchildren():
@@ -241,6 +247,7 @@ class Model(object):
self.count = 0
self.data['game_file'] = '%s_%s' % (category, language)
self.data['origin'] = 'art4apps'
+ self.data['language'] = language
self.data['path'] = self.temp_folder
self.data['pathimg'] = ART4APPS_IMAGE_PATH
self.data['pathsnd'] = join(ART4APPS_AUDIO_PATH, language)
@@ -287,6 +294,8 @@ class Model(object):
if 'origin' in self.data:
game_props['origin'] = self.data['origin']
+ if 'language' in self.data:
+ game_props['language'] = self.data['language']
if(self.data.get('equal_pairs', None) is not None):
game_props['equal_pairs'] = self.data['equal_pairs']