From e6b49cfdb3d072a169cc9d20a183bc555f1603c0 Mon Sep 17 00:00:00 2001 From: Sebastian Wehling-Benatelli Date: Mon, 31 Mar 2014 12:58:58 +0200 Subject: [PATCH] module pylot.core.util.connection added: contains routines for web and network utilization --- pylot/core/util/connection.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pylot/core/util/connection.py diff --git a/pylot/core/util/connection.py b/pylot/core/util/connection.py new file mode 100644 index 00000000..4f99ab81 --- /dev/null +++ b/pylot/core/util/connection.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- + +import urllib2 + + +def checkurl(url='https://ariadne.geophysik.rub.de/trac/PyLoT'): + try: + urllib2.urlopen(url, timeout=1) + return True + except urllib2.URLError: + pass + return False