def check_running_hub(lockfilename):
 is_running = False
 lockfiledict = {}
 try:
  lockfiledict = read_lockfile(lockfilename)
 except IOError:
  return (is_running, lockfiledict)
 if (u'samp.hub.xmlrpc.url' in lockfiledict):
  try:
   proxy = xmlrpc.ServerProxy(lockfiledict[u'samp.hub.xmlrpc.url'].replace(u'\\', u''), allow_none=1)
   proxy.samp.hub.ping()
   is_running = True
  except xmlrpc.ProtocolError:
   is_running = True
  except SSL_EXCEPTIONS:
   is_running = True
  except socket.error:
   pass
 return (is_running, lockfiledict)

def check_running_hub ( lockfilename ) : is_running = False lockfiledict = { } try : lockfiledict = read_lockfile ( lockfilename ) except IOError : return ( is_running , lockfiledict ) if ( u'samp.hub.xmlrpc.url' in lockfiledict ) : try : proxy = xmlrpc . ServerProxy ( lockfiledict [ u'samp.hub.xmlrpc.url' ] . replace ( u'\\' , u'' ) , allow_none = 1 ) proxy . samp . hub . ping ( ) is_running = True except xmlrpc . ProtocolError : is_running = True except SSL_EXCEPTIONS : is_running = True except socket . error : pass return ( is_running , lockfiledict )
test whether a hub identified by lockfilename is running or not .