当前位置: 首页>>代码示例>>Python>>正文


Python exit.err_exit函数代码示例

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


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

示例1: run_sftp

    def run_sftp(self, distfile, location):
        if not self.process.quiet:
            print 'running sftp_upload'
            self.delay()
            name = basename(distfile)
            print 'Uploading dist/%(name)s to %(location)s' % locals()

        with tempfile.NamedTemporaryFile() as file:
            cmds = 'put "%(distfile)s"\nbye\n' % locals()
            if sys.version_info[0] >= 3:
                cmds = encode(cmds)
            file.write(cmds)
            file.flush()
            cmdfile = file.name

            try:
                rc, lines = self.process.popen(
                    'sftp -b "%(cmdfile)s" "%(location)s"' % locals(),
                    echo=False)
                if rc == 0:
                    if not self.process.quiet:
                        print 'OK'
                    return rc
            except KeyboardInterrupt:
                pass
            err_exit('ERROR: sftp failed')
开发者ID:sixfeetup,项目名称:jarn.mkrelease,代码行数:26,代码来源:scp.py

示例2: run_register

    def run_register(self, dir, infoflags, location, ff='', quiet=False):
        if not self.process.quiet:
            print 'running register'

        echo = After('running register')
        if quiet:
            echo = And(echo, Not(Equals(OK_RESPONSE)))

        checkcmd = []
        if 'check' in distutils.command.__all__:
            checkcmd = ['check']

        serverflags = ['--repository="%(location)s"' % locals()]

        rc, lines = self._run_setup_py(
            ['egg_info'] + infoflags + checkcmd +
            ['register'] + serverflags,
            echo=echo,
            ff=ff)

        if rc == 0:
            if self._parse_register_results(lines):
                if not self.process.quiet and quiet:
                    print 'OK'
                return rc
        err_exit('ERROR: register failed')
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:26,代码来源:setuptools.py

示例3: get_options

    def get_options(self):
        """Process the command line.
        """
        args = self.parse_options(self.args)

        if args:
            self.directory = args[0]

        if self.list:
            self.list_locations()

        if not self.locations:
            self.locations.extend(self.locations.get_default_location())

        if not self.skipupload:
            self.locations.check_valid_locations()

        if len(args) > 1:
            if self.urlparser.is_url(self.directory):
                self.branch = args[1]
            elif self.urlparser.is_ssh_url(self.directory):
                self.branch = args[1]
            else:
                err_exit('mkrelease: too many arguments\n%s' % USAGE)

        if len(args) > 2:
            err_exit('mkrelease: too many arguments\n%s' % USAGE)
开发者ID:dokai,项目名称:jarn.mkrelease,代码行数:27,代码来源:mkrelease.py

示例4: create_tag

 def create_tag(self, dir, tagid, name, version, push):
     url = self.get_url_from_sandbox(dir)
     rc, lines = self.process.popen(
         ('svn copy -m"Tagged %(name)s %(version)s." "%(url)s" "%(tagid)s"' % locals()),
         echo=tee.NotEmpty())
     if rc != 0:
         err_exit('Tag failed')
     return rc
开发者ID:sixfeetup,项目名称:jarn.mkrelease,代码行数:8,代码来源:scm.py

示例5: get_url_from_sandbox

 def get_url_from_sandbox(self, dir):
     rc, lines = self.process.popen(
         'svn info "%(dir)s"' % locals(), echo=False)
     if rc == 0 and lines:
         if self.version_info[:2] >= (1, 7):
             return lines[2][5:]
         else:
             return lines[1][5:]
     err_exit('Failed to get URL from %(dir)s' % locals())
开发者ID:sixfeetup,项目名称:jarn.mkrelease,代码行数:9,代码来源:scm.py

示例6: get_package_info

 def get_package_info(self, dir, develop=False):
     python = self.python
     rc, lines = self.process.popen(
         '"%(python)s" setup.py --name --version' % locals(), echo=False)
     if rc == 0 and len(lines) == 2:
         name, version = lines
         if develop:
             parser = ConfigParser(warn)
             parser.read('setup.cfg')
             version += parser.get('egg_info', 'tag_build', '').strip()
         return name, pkg_resources.safe_version(version)
     err_exit('Bad setup.py')
开发者ID:SalesSeek,项目名称:jarn.mkrelease,代码行数:12,代码来源:setuptools.py


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