def get_running_hubs():
 hubs = {}
 lockfilename = u''
 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:
  lockfilename = os.path.join(_find_home(), u'.samp')
 (hub_is_running, lockfiledict) = check_running_hub(lockfilename)
 if hub_is_running:
  hubs[lockfilename] = lockfiledict
 lockfiledir = u''
 lockfiledir = os.path.join(_find_home(), u'.samp-1')
 if os.path.isdir(lockfiledir):
  for filename in os.listdir(lockfiledir):
   if filename.startswith(u'samp-hub'):
    lockfilename = os.path.join(lockfiledir, filename)
    (hub_is_running, lockfiledict) = check_running_hub(lockfilename)
    if hub_is_running:
     hubs[lockfilename] = lockfiledict
 return hubs

def get_running_hubs ( ) : hubs = { } lockfilename = u'' 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 : lockfilename = os . path . join ( _find_home ( ) , u'.samp' ) ( hub_is_running , lockfiledict ) = check_running_hub ( lockfilename ) if hub_is_running : hubs [ lockfilename ] = lockfiledict lockfiledir = u'' lockfiledir = os . path . join ( _find_home ( ) , u'.samp-1' ) if os . path . isdir ( lockfiledir ) : for filename in os . listdir ( lockfiledir ) : if filename . startswith ( u'samp-hub' ) : lockfilename = os . path . join ( lockfiledir , filename ) ( hub_is_running , lockfiledict ) = check_running_hub ( lockfilename ) if hub_is_running : hubs [ lockfilename ] = lockfiledict return hubs
return a dictionary containing the lock-file contents of all the currently running hubs .