diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2011-10-10 05:37:48 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2011-10-10 05:37:48 (GMT) |
commit | 632fd55ccb858cd027c57980abb2320aa42b6542 (patch) | |
tree | 261b83c25de214d51ec6212e5365b6b7f543c17a /model.py | |
parent | ad862f35cf74a23b1e7895c26fdfc541a369c326 (diff) |
Initial resources support
Diffstat (limited to 'model.py')
-rw-r--r-- | model.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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() |