Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2013-02-15 14:06:44 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2013-02-15 14:06:44 (GMT)
commit9843bf1f53f9c5ccfc6054a24aebc6a7eee3301c (patch)
tree0885fedf4b7785ad1d5404b78f0737592dbe63b3 /utils.py
parent75252307b7b5880ae3f427cf43b0f4b3edae30e9 (diff)
minor fix in get update list from servers
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/utils.py b/utils.py
index f449e1a..806d8ec 100644
--- a/utils.py
+++ b/utils.py
@@ -47,19 +47,18 @@ def get_logger():
def _know():
+ _file = None
try:
- remote_file = urllib.urlopen(LIST_DOWNLOAD)
- return LIST_DOWNLOAD
+ _file = urllib.urlopen(LIST_DOWNLOAD)
except:
try:
- remote_file = urllib.urlopen(LIST_DOWNLOAD_MIRROR1)
- return LIST_DOWNLOAD_MIRROR1
+ _file = urllib.urlopen(LIST_DOWNLOAD_MIRROR1)
except:
try:
- remote_file = urllib.urlopen(LIST_DOWNLOAD_MIRROR2)
- return LIST_DOWNLOAD_MIRROR2
+ _file = urllib.urlopen(LIST_DOWNLOAD_MIRROR2)
except:
- return "file://" + LIST_PATH
+ pass
+ return _file
def update_list():
@@ -67,11 +66,12 @@ def update_list():
global downloading
try:
downloading = True
- remote_file = urllib.urlopen(_know())
- _file = open(LIST_PATH, 'w')
- _file.write(remote_file.read())
- _file.close()
- remote_file.close()
+ remote_file = _know()
+ if remote_file is not None:
+ _file = open(LIST_PATH, 'w')
+ _file.write(remote_file.read())
+ _file.close()
+ remote_file.close()
except:
pass