Example #1
0
  def _main():
    """
      If called from __main__ module, run script's main() method.
    """
    main_method, main_module = Inspection._find_main_from_caller(), Inspection._find_main_module()
    if main_module != '__main__':
      # only support if __name__ == '__main__'
      return
    if main_method is None:
      print >> sys.stderr, 'No main() defined!  Application must define main function.'
      sys.exit(1)
    Methods._run_registry()

    try:
      argspec = inspect.getargspec(main_method)
    except TypeError, e:
      print >> sys.stderr, 'Malformed main(): %s' % e
      sys.exit(1)
Example #2
0
    def _main():
        """
      If called from __main__ module, run script's main() method.
    """
        main_method, main_module = Inspection._find_main_from_caller(
        ), Inspection._find_main_module()
        if main_module != '__main__':
            # only support if __name__ == '__main__'
            return
        if main_method is None:
            print >> sys.stderr, 'No main() defined!  Application must define main function.'
            sys.exit(1)
        Methods._run_registry()

        try:
            argspec = inspect.getargspec(main_method)
        except TypeError, e:
            print >> sys.stderr, 'Malformed main(): %s' % e
            sys.exit(1)
Example #3
0
def name():
  if _APP_NAME is not None:
    return _APP_NAME
  else:
    return Inspection._find_main_module()
Example #4
0
def name():
    if _APP_NAME is not None:
        return _APP_NAME
    else:
        return Inspection._find_main_module()