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


Python log.INFO属性代码示例

本文整理汇总了Python中distutils.log.INFO属性的典型用法代码示例。如果您正苦于以下问题:Python log.INFO属性的具体用法?Python log.INFO怎么用?Python log.INFO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在distutils.log的用法示例。


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

示例1: download_library

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def download_library(command):
    if command.dry_run:
        return
    libdir = absolute("libsecp256k1")
    if os.path.exists(os.path.join(libdir, "autogen.sh")):
        # Library already downloaded
        return
    if not os.path.exists(libdir):
        command.announce("downloading libsecp256k1 source code", level=log.INFO)
        try:
            r = urlopen(LIB_URL)
            if r.getcode() == 200:
                content = BytesIO(r.read())
                content.seek(0)
                with tarfile.open(fileobj=content) as tf:
                    dirname = tf.getnames()[0].partition('/')[0]
                    tf.extractall()
                shutil.move(dirname, libdir)
            else:
                raise SystemExit( "Unable to download secp256k1 library: HTTP-Status: %d", r.getcode())
        except URLError as ex:
            raise SystemExit("Unable to download secp256k1 library: %s", str(ex)) 
开发者ID:bitaps-com,项目名称:pybtc,代码行数:24,代码来源:setup_tools.py

示例2: custom_command

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def custom_command(subclass):
    orig_run = subclass.run

    def custom_run(self):
        # Check that this version of python is OK
        if sys.version_info < (3,5):
            sys.exit('Sorry, Python versions earlier than 3.5 are not supported')
        orig_run(self)
        self.announce(
'''###########################################
PyWEED has been installed!
###########################################''', level=log.INFO)

    subclass.run = custom_run
    return subclass 
开发者ID:iris-edu,项目名称:pyweed,代码行数:17,代码来源:setup.py

示例3: run_test

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def run_test(self, filename):
        path = os.path.join(self.path, filename)
        self.announce("Running %s..." % filename, log.INFO)
        try:
            execfile(path)
        except Exception, e:
            self.announce('Test case failed: %s (%r)' % (filename, e), log.FATAL)
            raise e 
开发者ID:ricmoo,项目名称:pycoind,代码行数:10,代码来源:setup.py

示例4: run

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def run(self):
        self.announce("Running Test Suite (version %s)" % version, log.INFO)
        if self.test:
            filename = 'test-%s.py' % self.test
            self.run_test(filename)
        else:
            for filename in os.listdir(self.path):
                if filename.startswith('test-') and filename.endswith('.py'):
                    self.run_test(filename) 
开发者ID:ricmoo,项目名称:pycoind,代码行数:11,代码来源:setup.py

示例5: dump_options

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def dump_options(self, header=None, indent=""):
        from distutils.fancy_getopt import longopt_xlate
        if header is None:
            header = "command options for '%s':" % self.get_command_name()
        self.announce(indent + header, level=log.INFO)
        indent = indent + "  "
        for (option, _, _) in self.user_options:
            option = option.translate(longopt_xlate)
            if option[-1] == "=":
                option = option[:-1]
            value = getattr(self, option)
            self.announce(indent + "%s = %s" % (option, value),
                          level=log.INFO) 
开发者ID:glmcdona,项目名称:meddle,代码行数:15,代码来源:cmd.py

示例6: announce

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def announce(self, msg, level=log.INFO):
        log.log(level, msg) 
开发者ID:glmcdona,项目名称:meddle,代码行数:4,代码来源:dist.py

示例7: write_pkg_info

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def write_pkg_info(self, base_dir):
        """Write the PKG-INFO file into the release tree.
        """
        pkg_info = open(os.path.join(base_dir, 'PKG-INFO'), 'w')
        try:
            self.write_pkg_file(pkg_info)
        finally:
            pkg_info.close() 
开发者ID:glmcdona,项目名称:meddle,代码行数:10,代码来源:dist.py

示例8: write_pkg_file

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def write_pkg_file(self, file):
        """Write the PKG-INFO format data to a file object.
        """
        version = '1.0'
        if self.provides or self.requires or self.obsoletes:
            version = '1.1'

        self._write_field(file, 'Metadata-Version', version)
        self._write_field(file, 'Name', self.get_name())
        self._write_field(file, 'Version', self.get_version())
        self._write_field(file, 'Summary', self.get_description())
        self._write_field(file, 'Home-page', self.get_url())
        self._write_field(file, 'Author', self.get_contact())
        self._write_field(file, 'Author-email', self.get_contact_email())
        self._write_field(file, 'License', self.get_license())
        if self.download_url:
            self._write_field(file, 'Download-URL', self.download_url)

        long_desc = rfc822_escape(self.get_long_description())
        self._write_field(file, 'Description', long_desc)

        keywords = ','.join(self.get_keywords())
        if keywords:
            self._write_field(file, 'Keywords', keywords)

        self._write_list(file, 'Platform', self.get_platforms())
        self._write_list(file, 'Classifier', self.get_classifiers())

        # PEP 314
        self._write_list(file, 'Requires', self.get_requires())
        self._write_list(file, 'Provides', self.get_provides())
        self._write_list(file, 'Obsoletes', self.get_obsoletes()) 
开发者ID:glmcdona,项目名称:meddle,代码行数:34,代码来源:dist.py

示例9: write_pkg_file

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def write_pkg_file(self, file):
        """Write the PKG-INFO format data to a file object.
        """
        version = '1.0'
        if (self.provides or self.requires or self.obsoletes or
            self.classifiers or self.download_url):
            version = '1.1'

        self._write_field(file, 'Metadata-Version', version)
        self._write_field(file, 'Name', self.get_name())
        self._write_field(file, 'Version', self.get_version())
        self._write_field(file, 'Summary', self.get_description())
        self._write_field(file, 'Home-page', self.get_url())
        self._write_field(file, 'Author', self.get_contact())
        self._write_field(file, 'Author-email', self.get_contact_email())
        self._write_field(file, 'License', self.get_license())
        if self.download_url:
            self._write_field(file, 'Download-URL', self.download_url)

        long_desc = rfc822_escape(self.get_long_description())
        self._write_field(file, 'Description', long_desc)

        keywords = ','.join(self.get_keywords())
        if keywords:
            self._write_field(file, 'Keywords', keywords)

        self._write_list(file, 'Platform', self.get_platforms())
        self._write_list(file, 'Classifier', self.get_classifiers())

        # PEP 314
        self._write_list(file, 'Requires', self.get_requires())
        self._write_list(file, 'Provides', self.get_provides())
        self._write_list(file, 'Obsoletes', self.get_obsoletes()) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:35,代码来源:dist.py

示例10: _log

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def _log(self, level, msg, args):
        if level not in (DEBUG, INFO, WARN, ERROR, FATAL):
            raise ValueError('%s wrong log level' % str(level))
        self.logs.append((level, msg, args)) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:6,代码来源:support.py

示例11: get_log_level

# 需要导入模块: from distutils import log [as 别名]
# 或者: from distutils.log import INFO [as 别名]
def get_log_level():
    # A hack to get the existing distutils logging level.
    existing_level = log.set_threshold(log.INFO)
    log.set_threshold(existing_level)

    return existing_level 
开发者ID:pantsbuild,项目名称:pex,代码行数:8,代码来源:bdist_pex.py


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