Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/model.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2011-10-10 05:37:48 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2011-10-10 05:37:48 (GMT)
commit632fd55ccb858cd027c57980abb2320aa42b6542 (patch)
tree261b83c25de214d51ec6212e5365b6b7f543c17a /model.py
parentad862f35cf74a23b1e7895c26fdfc541a369c326 (diff)
Initial resources support
Diffstat (limited to 'model.py')
-rw-r--r--model.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/model.py b/model.py
index 676874c..c809ae1 100644
--- a/model.py
+++ b/model.py
@@ -20,6 +20,13 @@ class GameModel:
'file_graph_mask' = ''}
"""
+ self.data['resources'] = []
+ """
+ resource = {'title' = '',
+ 'file_image' = ''
+ 'file_text' = ''}
+ """
+
def write(self, file_name):
instance_path = os.path.join(activity.get_activity_root(), 'instance')
@@ -69,5 +76,9 @@ class GameModel:
f = open(os.path.join(instance_path, data_file_name), 'r')
try:
self.data = simplejson.load(f)
+
+ if not 'resources' in self.data:
+ self.data['resources'] = []
+
finally:
f.close()