Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2012-06-09 01:56:09 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2012-06-09 01:56:09 (GMT)
commit0396e7ec8c4a2c51ed7f2d2bb672ee74fa539b62 (patch)
treeb8f72a9e8c17ebf0664c33dd503ad8959331c3f9
parent2a3df9e1f724c2229aadf92282b87d159ce2bd3f (diff)
evites errors in download/get lsit
-rw-r--r--utils.py37
1 files changed, 21 insertions, 16 deletions
diff --git a/utils.py b/utils.py
index 4acce70..7e7bcb3 100644
--- a/utils.py
+++ b/utils.py
@@ -43,27 +43,32 @@ def get_logger():
def update_list():
"""Download the latest list version"""
- remote_file = urllib.urlopen(LIST_DOWNLOAD)
- _file = open(LIST_PATH, 'w')
- _file.write(remote_file.read())
- _file.close()
- remote_file.close()
+ try:
+ remote_file = urllib.urlopen(LIST_DOWNLOAD)
+ _file = open(LIST_PATH, 'w')
+ _file.write(remote_file.read())
+ _file.close()
+ remote_file.close()
+ except:
+ pass
def get_store_list():
"""Returns the store list"""
- f = open(LIST_PATH, 'r')
-
store_list = []
- e = True
- while e:
- line = f.readline()
- if not(line):
- e = False
- else:
- line = line.replace('\n', '')
- l = line.split('|')
- store_list.append(l)
+ try:
+ f = open(LIST_PATH, 'r')
+ e = True
+ while e:
+ line = f.readline()
+ if not(line):
+ e = False
+ else:
+ line = line.replace('\n', '')
+ l = line.split('|')
+ store_list.append(l)
+ except:
+ pass
return store_list