Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgnacio 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)
commitf64a289b8b7bff9ffbb373d9e62c1053c01c84fb (patch)
tree8db802db975b77c0ae8b0f0033e65cb1c2e78e9e
parent253017bb52dd01b5aee591998ab63147be6401d0 (diff)
Mirrors for store
-rw-r--r--utils.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index 9eef88a..45e26db 100644
--- a/utils.py
+++ b/utils.py
@@ -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