def get_master_uri(required=True, env=None, argv=None):
 if (env is None):
  env = os.environ
 if (argv is None):
  argv = sys.argv
 try:
  for arg in argv:
   if arg.startswith('__master:='):
    val = None
    try:
     (_, val) = arg.split(':=')
    except:
     pass
    if (not val):
     raise ROSEnvException(("__master remapping argument '%s' improperly specified" % arg))
    return val
  return env[ROS_MASTER_URI]
 except KeyError as e:
  if required:
   raise ROSEnvException(('%s has not been configured' % ROS_MASTER_URI))

def get_master_uri ( required = True , env = None , argv = None ) : if ( env is None ) : env = os . environ if ( argv is None ) : argv = sys . argv try : for arg in argv : if arg . startswith ( '__master:=' ) : val = None try : ( _ , val ) = arg . split ( ':=' ) except : pass if ( not val ) : raise ROSEnvException ( ( "__master remapping argument '%s' improperly specified" % arg ) ) return val return env [ ROS_MASTER_URI ] except KeyError as e : if required : raise ROSEnvException ( ( '%s has not been configured' % ROS_MASTER_URI ) )
get the ros_master_uri setting from the command-line args or environment .