summaryrefslogtreecommitdiff
path: root/plugins/python/welcome/version.py
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-12-23 23:59:09 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-12-23 23:59:09 (GMT)
commit64b50b60e45e4d343ff257c3c9e10788f624a713 (patch)
treec2f06c08c1bdde4b848d4f7ce89af64cd04713ca /plugins/python/welcome/version.py
parent5710f9d5be56b427ccfa48f6a730d70396817efe (diff)
Avoided to crash when the website is not reachable.
Diffstat (limited to 'plugins/python/welcome/version.py')
-rw-r--r--plugins/python/welcome/version.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/python/welcome/version.py b/plugins/python/welcome/version.py
index 37ba001..c823d60 100644
--- a/plugins/python/welcome/version.py
+++ b/plugins/python/welcome/version.py
@@ -26,7 +26,11 @@ class VersionChecker(SmallBoard):
if has_urllib3:
lastest = self.get_lastest_version('community')
- up2date = self.get_update_status(current, lastest)
+
+ if lastest != None:
+ up2date = self.get_update_status(current, lastest)
+ else:
+ up2date = None
if lastest != None and up2date != None:
@@ -72,7 +76,7 @@ To display the lastest available version, please install the <b>urllib3</b> pack
lastest = None
http = urllib3.PoolManager()
- request = http.request('GET', 'http://localhost/mediawiki/data/versions')
+ request = http.request('GET', 'http://0xdeadc0de.fr/chrysalide/updates/versions')
html = request.data.decode('utf-8')
@@ -102,6 +106,6 @@ To display the lastest available version, please install the <b>urllib3</b> pack
def get_location(self):
- """Fournit la localisation souhaitée pour la plache."""
+ """Fournit la localisation souhaitée pour la planche."""
return [ 2, 0, 1, 1 ]