diff options
author | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-03-18 17:49:50 (GMT) |
---|---|---|
committer | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-03-18 17:49:50 (GMT) |
commit | d007a1f0599658d295ab4e2725add565e0f505fe (patch) | |
tree | aa6ff8c315572d51b45ab6836e5102cae27f6740 /utils.py | |
parent | 2e30a6ce69e29fd94ace4a93158ec396a26497c5 (diff) |
Auto update list
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -26,10 +26,19 @@ import urllib from sugar.activity import activity +LIST_DOWNLOAD = "https://sites.google.com/site/agustinzubiaga/archivos/store.lst" LIST_PATH = os.path.join(activity.get_activity_root(), 'data', 'store.lst') TMP_DIR = os.path.join(activity.get_activity_root(), "tmp") +def update_list(): + remote_file = urllib.urlopen(LIST_DOWNLOAD) + file = open(LIST_PATH, 'w') + file.write(remote_file.read()) + file.close() + remote_file.close() + + def get_store_list(): """Returns the store list""" file = open(LIST_PATH, 'r') @@ -78,3 +87,4 @@ def download_activity(id, progress_function): def install_activity(xofile): os.system('sugar-install-bundle %s' % xofile) + os.remove(xofile) |