def get_main_running_hub():
 hubs = get_running_hubs()
 if (not hubs):
  raise SAMPHubError(u'Unable to find a running SAMP Hub.')
 if (u'SAMP_HUB' in os.environ):
  if os.environ[u'SAMP_HUB'].startswith(u'std-lockurl:'):
   lockfilename = os.environ[u'SAMP_HUB'][len(u'std-lockurl:'):]
  else:
   raise SAMPHubError(u'SAMP Hub profile not supported.')
 else:
  lockfilename = os.path.join(_find_home(), u'.samp')
 return hubs[lockfilename]

def get_main_running_hub ( ) : hubs = get_running_hubs ( ) if ( not hubs ) : raise SAMPHubError ( u'Unable to find a running SAMP Hub.' ) if ( u'SAMP_HUB' in os . environ ) : if os . environ [ u'SAMP_HUB' ] . startswith ( u'std-lockurl:' ) : lockfilename = os . environ [ u'SAMP_HUB' ] [ len ( u'std-lockurl:' ) : ] else : raise SAMPHubError ( u'SAMP Hub profile not supported.' ) else : lockfilename = os . path . join ( _find_home ( ) , u'.samp' ) return hubs [ lockfilename ]
get either the hub given by the environment variable samp_hub .