mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-04 22:07:45 +00:00
remove unneded properties
This commit is contained in:
parent
04a8303ca9
commit
1776f91c9e
3 changed files with 17 additions and 47 deletions
|
|
@ -30,7 +30,7 @@ class NetCheck:
|
|||
@param timout: timout for connection check in sec. (1)"""
|
||||
self._hostname = hostname
|
||||
self._timeout = timeout
|
||||
self._connectionState = False
|
||||
self.connectionState = False
|
||||
self.checkConn() # initiate a first check
|
||||
|
||||
def checkConn(self):
|
||||
|
|
@ -40,14 +40,9 @@ class NetCheck:
|
|||
try:
|
||||
urlopen(self._hostname, timeout=self._timeout)
|
||||
logging.debug("%s is reachable", self._hostname)
|
||||
self._connectionState = True
|
||||
self.connectionState = True
|
||||
return True
|
||||
except: # todo find right exception type
|
||||
logging.warning("%s is not reachable", self._hostname)
|
||||
self._connectionState = False
|
||||
self.connectionState = False
|
||||
return False
|
||||
|
||||
@property
|
||||
def connectionState(self):
|
||||
"""!Property for the last connection state from checkConn()"""
|
||||
return self._connectionState
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue