diff options
author | Ignacio RodrÃguez <ignacio@sugarlabs.org> | 2013-02-15 12:53:40 (GMT) |
---|---|---|
committer | Ignacio RodrÃguez <ignacio@sugarlabs.org> | 2013-02-15 12:53:40 (GMT) |
commit | f64a289b8b7bff9ffbb373d9e62c1053c01c84fb (patch) | |
tree | 8db802db975b77c0ae8b0f0033e65cb1c2e78e9e | |
parent | 253017bb52dd01b5aee591998ab63147be6401d0 (diff) |
Mirrors for store
-rw-r--r-- | utils.py | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -28,6 +28,8 @@ from sugar.bundle.activitybundle import ActivityBundle # Paths LIST_DOWNLOAD = "http://www.fing.edu.uy/~aaguiar/files/store.lst" +LIST_DOWNLOAD_MIRROR1 = "http://people.sugarlabs.org/ignacio/store.lst" +LIST_DOWNLOAD_MIRROR2 = "http://people.sugarlabs.org/aguz/store.lst" LIST_PATH = os.path.join(activity.get_bundle_path(), 'store.lst') ICONS_DIR = os.path.join(activity.get_activity_root(), 'data') TMP_DIR = os.path.join(activity.get_activity_root(), "tmp") @@ -55,7 +57,23 @@ def update_list(): _file.close() remote_file.close() except: - pass + try: + downloading = True + remote_file = urllib.urlopen(LIST_DOWNLOAD_MIRROR1) + _file = open(LIST_PATH, 'w') + _file.write(remote_file.read()) + _file.close() + remote_file.close() + except: + try: + downloading = True + remote_file = urllib.urlopen(LIST_DOWNLOAD_MIRROR2) + _file = open(LIST_PATH, 'w') + _file.write(remote_file.read()) + _file.close() + remote_file.close() + except: + pass downloading = False |