diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-03-17 23:31:03 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-03-17 23:31:03 (GMT) |
commit | 476cffc9b69e1139fabb02a4513fb5884cf82c90 (patch) | |
tree | 03c8c81ffebb2abbea6782698a1c3442e759b1e4 /model.py | |
parent | c92b89948ddd1ce7dbaf475be3e1a686592ad00d (diff) |
Improve the resources dialog
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'model.py')
-rw-r--r-- | model.py | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -34,6 +34,13 @@ class GameModel: self.data['last_resource_id'] = self.data['last_resource_id'] + 1 return self.data['last_resource_id'] + def get_resource(self, id_resource): + for resource in self.data['resources']: + if resource['id_resource'] == int(id_resource): + return resource + logging.error('ERROR: resource %s not found', id_resource) + return None + def write(self, file_name): instance_path = os.path.join(activity.get_activity_root(), 'instance') |