From b300d0c578e49f0c9d0bdd5c142d8e61d7b2f3a5 Mon Sep 17 00:00:00 2001 From: Bastian Schroll Date: Fri, 21 Sep 2018 12:39:36 +0200 Subject: [PATCH] add docu to NetCheck class --- boswatch/network/netCheck.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boswatch/network/netCheck.py b/boswatch/network/netCheck.py index 4cccd1b..8b69703 100644 --- a/boswatch/network/netCheck.py +++ b/boswatch/network/netCheck.py @@ -24,10 +24,17 @@ class NetCheck: """!Worker class to check internet connection""" def __init__(self, hostname="https://www.google.com/", timeout=1): + """!Create a new NetCheck instance + + @param hostname: host against connection check is running ("https://www.google.com/") + @param timout: timout for connection check in sec.""" self._hostname = hostname self._timeout = timeout def checkConn(self): + """!Check the connection + + @return True or False""" try: urlopen(self._hostname, timeout=self._timeout) return True