コード例 #1
0
def main(argv):
    dispatcher = subcommand.CommandDispatcher(__name__)
    try:
        return dispatcher.execute(OptionParser(), argv)
    except auth.AuthenticationError as e:
        print >> sys.stderr, e
        return 1
コード例 #2
0
def main(argv):
    if sys.hexversion < 0x02060000:
        print('\nYour python version %s is unsupported, please upgrade.\n' %
              (sys.version.split(' ', 1)[0], ),
              file=sys.stderr)
        return 2
    dispatcher = subcommand.CommandDispatcher(__name__)
    return dispatcher.execute(OptionParser(), argv)
コード例 #3
0
def Main(argv):
    """Doesn't parse the arguments here, just find the right subcommand to
  execute."""
    if sys.hexversion < 0x02060000:
        print >> sys.stderr, (
            '\nYour python version %s is unsupported, please upgrade.\n' %
            sys.version.split(' ', 1)[0])
        return 2
    if not sys.executable:
        print >> sys.stderr, (
            '\nPython cannot find the location of it\'s own executable.\n')
        return 2
    fix_encoding.fix_encoding()
    disable_buffering()
    colorama.init()
    dispatcher = subcommand.CommandDispatcher(__name__)
    try:
        return dispatcher.execute(OptionParser(), argv)
    except KeyboardInterrupt:
        gclient_utils.GClientChildren.KillAllRemainingChildren()
        raise
    except (gclient_utils.Error, subprocess2.CalledProcessError), e:
        print >> sys.stderr, 'Error: %s' % str(e)
        return 1
コード例 #4
0
def main(argv):
  dispatcher = subcommand.CommandDispatcher(__name__)
  return dispatcher.execute(OptionParser(), argv)
コード例 #5
0
ファイル: git_freezer.py プロジェクト: Andrewou2010/webview
def main(args):
    dispatcher = subcommand.CommandDispatcher(__name__)
    ret = dispatcher.execute(optparse.OptionParser(), args)
    if ret:
        print(ret)
    return 0
コード例 #6
0
def main():
    dispatcher = subcommand.CommandDispatcher(__name__)
    ret = dispatcher.execute(optparse.OptionParser(), sys.argv[1:])
    if ret:
        print ret
コード例 #7
0
 def setUp(self):
     super(SubcommandTest, self).setUp()
     self.module = mock.Mock(__doc__='Module documentation')
     self.parser = mock.Mock()
     self.sc = subcommand.CommandDispatcher(__name__)
     self.sc.module = self.module