diff options
author | Simon Schampijer <simon@schampijer.de> | 2009-06-10 21:18:31 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2009-06-10 21:18:31 (GMT) |
commit | 6da68b08c94f321a755140c59e30c823ada72f67 (patch) | |
tree | 30c6bdddf5dab771cc994e2353ed1f86bd75fcfc /cardlist.py | |
parent | 86fede1d18fead4833543e4392419bc66580354b (diff) |
Remove code duplication
Diffstat (limited to 'cardlist.py')
-rw-r--r-- | cardlist.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/cardlist.py b/cardlist.py index f324ad0..55bb2bc 100644 --- a/cardlist.py +++ b/cardlist.py @@ -30,7 +30,6 @@ import random from gobject import SIGNAL_RUN_FIRST, TYPE_PYOBJECT from sugar import profile -from sugar.datastore import datastore import theme @@ -170,15 +169,8 @@ class CardList(gtk.EventBox): game_model.pairs[pair] = pair_card game_model.write(equal_pairs, grouped) zip.write(join(temp_folder, 'game.xml'), 'game.xml') - zip.close() - - # Saves the zip in datastore - gameObject = datastore.create() - gameObject.metadata['title'] = game_name - gameObject.metadata['mime_type'] = 'application/x-memorize-project' - gameObject.metadata['icon-color'] = profile.get_color().to_string() - gameObject.file_path = join(temp_folder, 'game.zip') - datastore.write(gameObject) + zip.close() + game_model.save_byte_array(join(temp_folder, 'game.zip'), game_name) def clean_list(self, button = None): if button != None: |