• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python version.str函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中version.str函数的典型用法代码示例。如果您正苦于以下问题:Python str函数的具体用法?Python str怎么用?Python str使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了str函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: run

def run(args):
    ec = 0
    try:
        optargs = {"--list-configs": "List available configurations"}
        opts = options.load(args, optargs)
        log.notice("RTEMS Source Builder, Package Builder v%s" % (version.str()))
        if not check.host_setup(opts):
            if not opts.force():
                raise error.general("host build environment is not set up" + " correctly (use --force to proceed)")
            log.notice("warning: forcing build with known host setup problems")
        if opts.get_arg("--list-configs"):
            configs = get_configs(opts)
            for p in configs["paths"]:
                print "Examining: %s" % (os.path.relpath(p))
                for c in configs["files"]:
                    if c.endswith(".cfg"):
                        print "    %s" % (c)
        else:
            for config_file in opts.config_files():
                b = build(config_file, True, opts)
                b.make()
                b = None
    except error.general, gerr:
        log.stderr("Build FAILED")
        ec = 1
开发者ID:krzysiekm13,项目名称:rtems-source-builder,代码行数:25,代码来源:build.py


示例2: run

def run():
    import sys
    ec = 0
    setbuilder_error = False
    try:
        optargs = { '--list-configs':  'List available configurations',
                    '--list-bsets':    'List available build sets',
                    '--list-deps':     'List the dependent files.',
                    '--bset-tar-file': 'Create a build set tar file',
                    '--pkg-tar-files': 'Create package tar files',
                    '--no-report':     'Do not create a package report.',
                    '--report-format': 'The report format (text, html, asciidoc).' }
        mailer.append_options(optargs)
        opts = options.load(sys.argv, optargs)
        log.notice('RTEMS Source Builder - Set Builder, %s' % (version.str()))
        opts.log_info()
        if not check.host_setup(opts):
            raise error.general('host build environment is not set up correctly')
        configs = build.get_configs(opts)
        if opts.get_arg('--list-deps'):
            deps = []
        else:
            deps = None
        if not list_bset_cfg_files(opts, configs):
            prefix = opts.defaults.expand('%{_prefix}')
            if opts.canadian_cross():
                opts.disable_install()

            if not opts.dry_run() and \
               not opts.canadian_cross() and \
               not opts.no_install() and \
               not path.ispathwritable(prefix):
                raise error.general('prefix is not writable: %s' % (path.host(prefix)))
            for bset in opts.params():
                setbuilder_error = True
                b = buildset(bset, configs, opts)
                b.build(deps)
                b = None
                setbuilder_error = False
        if deps is not None:
            c = 0
            for d in sorted(set(deps)):
                c += 1
                print('dep[%d]: %s' % (c, d))
    except error.general as gerr:
        if not setbuilder_error:
            log.stderr(str(gerr))
        log.stderr('Build FAILED')
        ec = 1
    except error.internal as ierr:
        if not setbuilder_error:
            log.stderr(str(ierr))
        log.stderr('Internal Build FAILED')
        ec = 1
    except error.exit as eerr:
        pass
    except KeyboardInterrupt:
        log.notice('abort: user terminated')
        ec = 1
    sys.exit(ec)
开发者ID:Sambeet161616,项目名称:rtems-source-builder,代码行数:60,代码来源:setbuilder.py


示例3: run

def run(args):
    try:
        optargs = { '--rtems':      'The RTEMS source directory',
                    '--rtems-bsp':  'The RTEMS BSP (arch/bsp)',
                    '--list':       'List the configurations' }
        opts = options.load(sys.argv, optargs)

        if opts.get_arg('--rtems'):
            prefix = opts.get_arg('--rtems')[1]
        else:
            prefix = os.getcwd()
        if opts.get_arg('--rtems-bsp') is None:
            raise error.general('no --rtems-bsp option; please provide')

        bsp = bsp_config(opts, prefix, opts.get_arg('--rtems-bsp')[1])

        if opts.get_arg('--list'):
            log.notice('RTEMS Source Builder - RTEMS Configuration, %s' % (version.str()))
            opts.log_info()
            configs = bsp.keys()
            for c in sorted(configs.keys()):
                print c
        else:
            for p in opts.params():
                print bsp.find(p)

    except error.general, gerr:
        print gerr
        sys.exit(1)
开发者ID:AnonymousPBoC,项目名称:rtems-source-builder,代码行数:29,代码来源:rtemsconfig.py


示例4: run

def run():
    import sys
    try:
        _opts = options.load(args = sys.argv, logfile = False)
        log.notice('RTEMS Source Builder - Check, %s' % (version.str()))

        orphans = _opts.parse_args('--check-orphans', error = False, extra = False)
        if orphans:
            print('Checking for orphans...')
            check_orphans(_opts)
        else:
            if host_setup(_opts):
                print('Environment is ok')
            else:
                print('Environment is not correctly set up')
    except error.general as gerr:
        print(gerr)
        sys.exit(1)
    except error.internal as ierr:
        print(ierr)
        sys.exit(1)
    except error.exit as eerr:
        pass
    except KeyboardInterrupt:
        log.notice('abort: user terminated')
        sys.exit(1)
    sys.exit(0)
开发者ID:RTEMS,项目名称:rtems-source-builder,代码行数:27,代码来源:check.py


示例5: run

def run(args):
    try:
        long_opts = {
            # key              macro         handler   param  defs   init
            '--test-path'  : ('_test_path',  'path',   True,  None,  False),
            '--test-jobs'  : ('_test_jobs',  'jobs',   True,  'max', True),
            '--test-bool'  : ('_test_bool',  'bool',   False, '0',   True)
        }
        opts = command_line(base_path = '.',
                            argv = args,
                            optargs = None,
                            defaults = macros.macros(),
                            long_opts = long_opts,
                            command_path = '.')
        load(opts)
        log.notice('RTEMS Tools Project - Defaults, v%s' % (version.str()))
        opts.log_info()
        log.notice('Options:')
        log.notice(str(opts))
        log.notice('Defaults:')
        log.notice(str(opts.defaults))
    except error.general as gerr:
        print(gerr)
        sys.exit(1)
    except error.internal as ierr:
        print(ierr)
        sys.exit(1)
    except error.exit:
        pass
    except KeyboardInterrupt:
        _notice(opts, 'abort: user terminated')
        sys.exit(1)
    sys.exit(0)
开发者ID:RTEMS,项目名称:rtems-tools,代码行数:33,代码来源:options.py


示例6: run

def run(args):
    ec = 0
    try:
        optargs = { '--list-configs': 'List available configurations' }
        opts = options.load(args, optargs)
        log.notice('RTEMS Source Builder, Package Builder v%s' % (version.str()))
        if not check.host_setup(opts):
            if not opts.force():
                raise error.general('host build environment is not set up' +
                                    ' correctly (use --force to proceed)')
            log.notice('warning: forcing build with known host setup problems')
        if opts.get_arg('--list-configs'):
            configs = get_configs(opts)
            for p in configs['paths']:
                print 'Examining: %s' % (os.path.relpath(p))
                for c in configs['files']:
                    if c.endswith('.cfg'):
                        print '    %s' % (c)
        else:
            for config_file in opts.config_files():
                b = build(config_file, True, opts)
                b.make()
                b = None
    except error.general, gerr:
        log.stderr('Build FAILED')
        ec = 1
开发者ID:bengras,项目名称:rtems-source-builder,代码行数:26,代码来源:build.py


示例7: run

def run():
    import sys

    ec = 0
    setbuilder_error = False
    try:
        optargs = {
            "--list-configs": "List available configurations",
            "--list-bsets": "List available build sets",
            "--list-deps": "List the dependent files.",
            "--bset-tar-file": "Create a build set tar file",
            "--pkg-tar-files": "Create package tar files",
            "--no-report": "Do not create a package report.",
            "--report-format": "The report format (text, html, asciidoc).",
        }
        mailer.append_options(optargs)
        opts = options.load(sys.argv, optargs)
        log.notice("RTEMS Source Builder - Set Builder, %s" % (version.str()))
        opts.log_info()
        if not check.host_setup(opts):
            raise error.general("host build environment is not set up correctly")
        configs = build.get_configs(opts)
        if opts.get_arg("--list-deps"):
            deps = []
        else:
            deps = None
        if not list_bset_cfg_files(opts, configs):
            prefix = opts.defaults.expand("%{_prefix}")
            if opts.canadian_cross():
                opts.disable_install()

            if (
                not opts.dry_run()
                and not opts.canadian_cross()
                and not opts.no_install()
                and not path.ispathwritable(prefix)
            ):
                raise error.general("prefix is not writable: %s" % (path.host(prefix)))
            for bset in opts.params():
                setbuilder_error = True
                b = buildset(bset, configs, opts)
                b.build(deps)
                b = None
                setbuilder_error = False
        if deps is not None:
            c = 0
            for d in sorted(set(deps)):
                c += 1
                print "dep[%d]: %s" % (c, d)
    except error.general, gerr:
        if not setbuilder_error:
            log.stderr(str(gerr))
        log.stderr("Build FAILED")
        ec = 1
开发者ID:AnonymousPBoC,项目名称:rtems-source-builder,代码行数:54,代码来源:setbuilder.py


示例8: run

def run(args):
    try:
        optargs = { '--list-bsets':   'List available build sets',
                    '--list-configs': 'List available configurations',
                    '--format':       'Output format (text, html, asciidoc, ini)',
                    '--output':       'File name to output the report' }
        opts = options.load(args, optargs)
        if opts.get_arg('--output') and len(opts.params()) > 1:
            raise error.general('--output can only be used with a single config')
        print 'RTEMS Source Builder, Reporter v%s' % (version.str())
        opts.log_info()
        if not check.host_setup(opts):
            log.warning('forcing build with known host setup problems')
        configs = build.get_configs(opts)
        if not setbuilder.list_bset_cfg_files(opts, configs):
            output = opts.get_arg('--output')
            if output is not None:
                output = output[1]
            format = 'text'
            ext = '.txt'
            format_opt = opts.get_arg('--format')
            if format_opt:
                if len(format_opt) != 2:
                    raise error.general('invalid format option: %s' % ('='.join(format_opt)))
                if format_opt[1] == 'text':
                    pass
                elif format_opt[1] == 'asciidoc':
                    format = 'asciidoc'
                    ext = '.txt'
                elif format_opt[1] == 'html':
                    format = 'html'
                    ext = '.html'
                elif format_opt[1] == 'ini':
                    format = 'ini'
                    ext = '.ini'
                else:
                    raise error.general('invalid format: %s' % (format_opt[1]))
            r = report(format, configs, opts)
            for _config in opts.params():
                if output is None:
                    outname = path.splitext(_config)[0] + ext
                    outname = outname.replace('/', '-')
                else:
                    outname = output
                config = build.find_config(_config, configs)
                if config is None:
                    raise error.general('config file not found: %s' % (inname))
                r.create(config, outname)
            del r
        else:
            raise error.general('invalid config type: %s' % (config))
    except error.general, gerr:
        print gerr
        sys.exit(1)
开发者ID:SayCV,项目名称:rtems-source-builder,代码行数:54,代码来源:reports.py


示例9: run

def run(args):
    try:
        _opts = load(args = args, defaults = 'rtems/testing/defaults.mc')
        log.notice('RTEMS Test - Defaults, v%s' % (version.str()))
        _opts.log_info()
        log.notice('Options:')
        log.notice(str(_opts))
        log.notice('Defaults:')
        log.notice(str(_opts.defaults))
    except error.general, gerr:
        print gerr
        sys.exit(1)
开发者ID:bengras,项目名称:rtems-tools,代码行数:12,代码来源:options.py


示例10: run

def run():
    import sys
    try:
        _opts = options.load(args = sys.argv)
        log.notice('RTEMS Source Builder - Check, v%s' % (version.str()))
        if host_setup(_opts):
            print 'Environment is ok'
        else:
            print 'Environment is not correctly set up'
    except error.general, gerr:
        print gerr
        sys.exit(1)
开发者ID:SayCV,项目名称:rtems-source-builder,代码行数:12,代码来源:check.py


示例11: run

def run(args):
    try:
        _opts = load(args=args, defaults=defaults_mc)
        log.notice("RTEMS Test - Defaults, v%s" % (version.str()))
        _opts.log_info()
        log.notice("Options:")
        log.notice(str(_opts))
        log.notice("Defaults:")
        log.notice(str(_opts.defaults))
    except error.general, gerr:
        print gerr
        sys.exit(1)
开发者ID:ryoon,项目名称:rtems-tools,代码行数:12,代码来源:options.py


示例12: run

def run(args):
    try:
        optargs = {
            "--list-bsets": "List available build sets",
            "--list-configs": "List available configurations",
            "--format": "Output format (text, html, asciidoc)",
            "--output": "File name to output the report",
        }
        opts = options.load(args, optargs)
        if opts.get_arg("--output") and len(opts.params()) > 1:
            raise error.general("--output can only be used with a single config")
        print "RTEMS Source Builder, Reporter v%s" % (version.str())
        opts.log_info()
        if not check.host_setup(opts):
            log.warning("forcing build with known host setup problems")
        configs = build.get_configs(opts)
        if not setbuilder.list_bset_cfg_files(opts, configs):
            output = opts.get_arg("--output")
            if output is not None:
                output = output[1]
            format = "text"
            ext = ".txt"
            format_opt = opts.get_arg("--format")
            if format_opt:
                if len(format_opt) != 2:
                    raise error.general("invalid format option: %s" % ("=".join(format_opt)))
                if format_opt[1] == "text":
                    pass
                elif format_opt[1] == "asciidoc":
                    format = "asciidoc"
                    ext = ".txt"
                elif format_opt[1] == "html":
                    format = "html"
                    ext = ".html"
                else:
                    raise error.general("invalid format: %s" % (format_opt[1]))
            r = report(format, configs, opts)
            for _config in opts.params():
                if output is None:
                    outname = path.splitext(_config)[0] + ext
                    outname = outname.replace("/", "-")
                else:
                    outname = output
                config = build.find_config(_config, configs)
                if config is None:
                    raise error.general("config file not found: %s" % (inname))
                r.create(config, outname)
            del r
        else:
            raise error.general("invalid config type: %s" % (config))
    except error.general, gerr:
        print gerr
        sys.exit(1)
开发者ID:CRempel,项目名称:rtems-source-builder,代码行数:53,代码来源:reports.py


示例13: run

def run(args):
    try:
        _opts = load(args = args, defaults = 'defaults.mc')
        log.notice('RTEMS Source Builder - Defaults, v%s' % (version.str()))
        _opts.log_info()
        log.notice('Options:')
        log.notice(str(_opts))
        log.notice('Defaults:')
        log.notice(str(_opts.defaults))
        log.notice('with-opt1: %r' % (_opts.with_arg('opt1')))
        log.notice('without-opt2: %r' % (_opts.with_arg('opt2')))
    except error.general, gerr:
        print gerr
        sys.exit(1)
开发者ID:claudioscordino,项目名称:rtems-source-builder,代码行数:14,代码来源:options.py


示例14: run

def run(args):
    try:
        #
        # On Windows MSYS2 prepends a path to itself to the environment
        # path. This means the RTEMS specific automake is not found and which
        # breaks the bootstrap. We need to remove the prepended path. Also
        # remove any ACLOCAL paths from the environment.
        #
        if os.name == 'nt':
            cspath = os.environ['PATH'].split(os.pathsep)
            if 'msys' in cspath[0] and cspath[0].endswith('bin'):
                os.environ['PATH'] = os.pathsep.join(cspath[1:])
            if 'ACLOCAL_PATH' in os.environ:
                #
                # The clear fails on a current MSYS2 python (Feb 2016). Delete
                # the entry if the clear fails.
                #
                try:
                    os.environ['ACLOCAL_PATH'].clear()
                except:
                    del os.environ['ACLOCAL_PATH']
        optargs = { '--rtems':       'The RTEMS source directory',
                    '--preinstall':  'Preinstall AM generation' }
        log.notice('RTEMS Source Builder - RTEMS Bootstrap, %s' % (version.str()))
        opts = options.load(sys.argv, optargs, logfile = False)
        if opts.get_arg('--rtems'):
            topdir = opts.get_arg('--rtems')
        else:
            topdir = os.getcwd()
        if opts.get_arg('--preinstall'):
            preinstall(topdir, opts.jobs(opts.defaults['_ncpus']))
        else:
            generate(topdir, opts.jobs(opts.defaults['_ncpus']))
    except error.general as gerr:
        print(gerr)
        print('Bootstrap FAILED', file = sys.stderr)
        sys.exit(1)
    except error.internal as ierr:
        print(ierr)
        print('Bootstrap FAILED', file = sys.stderr)
        sys.exit(1)
    except error.exit as eerr:
        pass
    except KeyboardInterrupt:
        log.notice('abort: user terminated')
        sys.exit(1)
    sys.exit(0)
开发者ID:mdavidsaver,项目名称:rsb,代码行数:47,代码来源:bootstrap.py


示例15: run

def run(args):
    try:
        optargs = { '--rtems':       'The RTEMS source directory',
                    '--preinstall':  'Preinstall AM generation' }
        log.notice('RTEMS Source Builder - RTEMS Bootstrap, v%s' % (version.str()))
        opts = options.load(sys.argv, optargs)
        if opts.get_arg('--rtems'):
            topdir = opts.get_arg('--rtems')
        else:
            topdir = os.getcwd()
        if opts.get_arg('--preinstall'):
            preinstall(topdir, opts.defaults['_ncpus'])
        else:
            generate(topdir, opts.defaults['_ncpus'])
    except error.general, gerr:
        print gerr
        print >> sys.stderr, 'Bootstrap FAILED'
        sys.exit(1)
开发者ID:CRempel,项目名称:rtems-source-builder,代码行数:18,代码来源:bootstrap.py


示例16: run

def run():
    import sys
    try:
        _opts = options.load(args = sys.argv)
        log.notice('RTEMS Source Builder - Check, v%s' % (version.str()))
        if host_setup(_opts):
            print('Environment is ok')
        else:
            print('Environment is not correctly set up')
    except error.general as gerr:
        print(gerr)
        sys.exit(1)
    except error.internal as ierr:
        print (ierr)
        sys.exit(1)
    except error.exit:
        pass
    except KeyboardInterrupt:
        log.notice('abort: user terminated')
        sys.exit(1)
    sys.exit(0)
开发者ID:AnonymousPBoC,项目名称:rtems-tools,代码行数:21,代码来源:check.py


示例17: run

def run(args):
    try:
        _opts = load(args = args, defaults = defaults_mc)
        log.notice('RTEMS Test - Defaults, v%s' % (version.str()))
        _opts.log_info()
        log.notice('Options:')
        log.notice(str(_opts))
        log.notice('Defaults:')
        log.notice(str(_opts.defaults))
    except error.general as gerr:
        print(gerr)
        sys.exit(1)
    except error.internal as ierr:
        print(ierr)
        sys.exit(1)
    except error.exit:
        pass
    except KeyboardInterrupt:
        log.notice('abort: user terminated')
        sys.exit(1)
    sys.exit(0)
开发者ID:AnonymousPBoC,项目名称:rtems-tools,代码行数:21,代码来源:options.py


示例18: run

def run():
    import sys
    try:
        optargs = { '--list-configs':  'List available configurations',
                    '--list-bsets':    'List available build sets',
                    '--list-deps':     'List the dependent files.',
                    '--bset-tar-file': 'Create a build set tar file',
                    '--pkg-tar-files': 'Create package tar files',
                    '--no-report':     'Do not create a package report.',
                    '--report-format': 'The report format (text, html, asciidoc).' }
        mailer.append_options(optargs)
        opts = options.load(sys.argv, optargs)
        log.notice('RTEMS Source Builder - Set Builder, v%s' % (version.str()))
        opts.log_info()
        if not check.host_setup(opts):
            raise error.general('host build environment is not set up correctly')
        configs = build.get_configs(opts)
        if opts.get_arg('--list-deps'):
            deps = []
        else:
            deps = None
        if not list_bset_cfg_files(opts, configs):
            prefix = opts.defaults.expand('%{_prefix}')
            if not opts.dry_run() and not opts.no_install() and \
                    not path.ispathwritable(prefix):
                raise error.general('prefix is not writable: %s' % (path.host(prefix)))
            for bset in opts.params():
                b = buildset(bset, configs, opts)
                b.build(deps)
                del b
        if deps is not None:
            c = 0
            for d in sorted(set(deps)):
                c += 1
                print 'dep[%d]: %s' % (c, d)
    except error.general, gerr:
        log.notice(str(gerr))
        print >> sys.stderr, 'Build FAILED'
        sys.exit(1)
开发者ID:CRempel,项目名称:rtems-source-builder,代码行数:39,代码来源:setbuilder.py


示例19: run

def run(args):
    try:
        optargs = { '--rtems':      'The RTEMS source directory',
                    '--rtems-bsp':  'The RTEMS BSP (arch/bsp)',
                    '--list':       'List the configurations' }
        opts = options.load(sys.argv, optargs)

        if opts.get_arg('--rtems'):
            prefix = opts.get_arg('--rtems')[1]
        else:
            prefix = os.getcwd()
        if opts.get_arg('--rtems-bsp') is None:
            raise error.general('no --rtems-bsp option; please provide')

        bsp = bsp_config(opts, prefix, opts.get_arg('--rtems-bsp')[1])

        if opts.get_arg('--list'):
            log.notice('RTEMS Source Builder - RTEMS Configuration, %s' % (version.str()))
            opts.log_info()
            configs = list(bsp.keys())
            for c in sorted(configs.keys()):
                print(c)
        else:
            for p in opts.params():
                print(bsp.find(p))

    except error.general as gerr:
        print(gerr)
        sys.exit(1)
    except error.internal as ierr:
        print(ierr)
        sys.exit(1)
    except error.exit as eerr:
        pass
    except KeyboardInterrupt:
        log.notice('abort: user terminated')
        sys.exit(1)
    sys.exit(0)
开发者ID:RTEMS,项目名称:rtems-source-builder,代码行数:38,代码来源:rtemsconfig.py


示例20: run

def run(args):
    try:
        _opts = load(args = args, defaults = 'defaults.mc')
        log.notice('RTEMS Source Builder - Defaults, %s' % (version.str()))
        _opts.log_info()
        log.notice('Options:')
        log.notice(str(_opts))
        log.notice('Defaults:')
        log.notice(str(_opts.defaults))
        log.notice('with-opt1: %r' % (_opts.with_arg('opt1')))
        log.notice('without-opt2: %r' % (_opts.with_arg('opt2')))
    except error.general as gerr:
        print(gerr)
        sys.exit(1)
    except error.internal as ierr:
        print(ierr)
        sys.exit(1)
    except error.exit as eerr:
        pass
    except KeyboardInterrupt:
        _notice(opts, 'abort: user terminated')
        sys.exit(1)
    sys.exit(0)
开发者ID:RTEMS,项目名称:rtems-source-builder,代码行数:23,代码来源:options.py



注:本文中的version.str函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python version.Version类代码示例发布时间:2022-05-26
下一篇:
Python version.get_version函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap