Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorAgustin Zubiaga <aguz@sugarlabs.org>2012-03-18 17:49:50 (GMT)
committer Agustin Zubiaga <aguz@sugarlabs.org>2012-03-18 17:49:50 (GMT)
commitd007a1f0599658d295ab4e2725add565e0f505fe (patch)
treeaa6ff8c315572d51b45ab6836e5102cae27f6740 /utils.py
parent2e30a6ce69e29fd94ace4a93158ec396a26497c5 (diff)
Auto update list
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils.py b/utils.py
index da68751..8fc2edf 100644
--- a/utils.py
+++ b/utils.py
@@ -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)