コード例 #1
0
ファイル: __init__.py プロジェクト: lafada/kalapy
    def run(self, args=None):
        args = args or sys.argv[1:]

        try:
            opts, args = getopt.getopt(args, 'h', ['help', 'version'])
            opts = dict(opts)
        except:
            opts = {}
            args = []

        if '-h' in opts or '--help' in opts:
            self.print_help()

        if '--version' in opts:
            print get_version()
            sys.exit(0)

        if not args:
            self.print_help()
        if args[0] == 'help':
            if len(args) == 1:
                self.print_help()
            args = [args[1], '-h']

        cmd = args.pop(0)

        if cmd.startswith('-'):
            self.print_help()

        try:
            command = REGISTRY[cmd]
        except:
            raise CommandError('no such command %r' % cmd)

        command().run(args)
コード例 #2
0
ファイル: __init__.py プロジェクト: garyyeap/zoe-robot
    def run(self, args=None):
        args = args or sys.argv[1:]

        try:
            opts, args = getopt.getopt(args, 'h', ['help', 'version'])
            opts = dict(opts)
        except:
            opts = {}
            args = []

        if '-h' in opts or '--help' in opts:
            self.print_help()

        if '--version' in opts:
            print get_version()
            sys.exit(0)

        if not args:
            self.print_help()
        if args[0] == 'help':
            if len(args) == 1:
                self.print_help()
            args = [args[1], '-h']

        cmd = args.pop(0)

        if cmd.startswith('-'):
            self.print_help()

        try:
            command = REGISTRY[cmd]
        except KeyError:
            self.print_error('Error: No such command %r.' % cmd)
        else:
            command().run(args)
コード例 #3
0
ファイル: conf.py プロジェクト: fanchlegal/framepy
# The master toctree document.
master_doc = "index"

# General information about the project.
project = u"KalaPy"
copyright = u"2010, Amit Mendapara"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
from kalapy import get_version

# The short X.Y version.
version = get_version()
# The full version, including alpha/beta/rc tags.
release = get_version()

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
# today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
# unused_docs = []