當前位置: 首頁>>代碼示例>>Python>>正文


Python log.set_verbosity方法代碼示例

本文整理匯總了Python中distutils.log.set_verbosity方法的典型用法代碼示例。如果您正苦於以下問題:Python log.set_verbosity方法的具體用法?Python log.set_verbosity怎麽用?Python log.set_verbosity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在distutils.log的用法示例。


在下文中一共展示了log.set_verbosity方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def run(self):
        if self.verbose != self.distribution.verbose:
            log.set_verbosity(self.verbose)
        try:
            for spec in self.args:
                self.easy_install(spec, not self.no_deps)
            if self.record:
                outputs = self.outputs
                if self.root:  # strip any package prefix
                    root_len = len(self.root)
                    for counter in range(len(outputs)):
                        outputs[counter] = outputs[counter][root_len:]
                from distutils import file_util

                self.execute(
                    file_util.write_file, (self.record, outputs),
                    "writing list of installed files to '%s'" %
                    self.record
                )
            self.warn_deprecated_options()
        finally:
            log.set_verbosity(self.distribution.verbose) 
開發者ID:jpush,項目名稱:jbox,代碼行數:24,代碼來源:easy_install.py

示例2: build_and_install

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def build_and_install(self, setup_script, setup_base):
        args = ['bdist_egg', '--dist-dir']

        dist_dir = tempfile.mkdtemp(
            prefix='egg-dist-tmp-', dir=os.path.dirname(setup_script)
        )
        try:
            self._set_fetcher_options(os.path.dirname(setup_script))
            args.append(dist_dir)

            self.run_setup(setup_script, setup_base, args)
            all_eggs = Environment([dist_dir])
            eggs = []
            for key in all_eggs:
                for dist in all_eggs[key]:
                    eggs.append(self.install_egg(dist.location, setup_base))
            if not eggs and not self.dry_run:
                log.warn("No eggs found in %s (setup script problem?)",
                         dist_dir)
            return eggs
        finally:
            rmtree(dist_dir)
            log.set_verbosity(self.verbose)  # restore our log verbosity 
開發者ID:jpush,項目名稱:jbox,代碼行數:25,代碼來源:easy_install.py

示例3: byte_compile

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def byte_compile(self, to_compile):
        if sys.dont_write_bytecode:
            self.warn('byte-compiling is disabled, skipping.')
            return

        from distutils.util import byte_compile

        try:
            # try to make the byte compile messages quieter
            log.set_verbosity(self.verbose - 1)

            byte_compile(to_compile, optimize=0, force=1, dry_run=self.dry_run)
            if self.optimize:
                byte_compile(
                    to_compile, optimize=self.optimize, force=1,
                    dry_run=self.dry_run
                )
        finally:
            log.set_verbosity(self.verbose)  # restore original verbosity 
開發者ID:jpush,項目名稱:jbox,代碼行數:21,代碼來源:easy_install.py

示例4: run

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def run(self):
        if self.verbose != self.distribution.verbose:
            log.set_verbosity(self.verbose)
        try:
            for spec in self.args:
                self.easy_install(spec, not self.no_deps)
            if self.record:
                outputs = list(sorted(self.outputs))
                if self.root:  # strip any package prefix
                    root_len = len(self.root)
                    for counter in range(len(outputs)):
                        outputs[counter] = outputs[counter][root_len:]
                from distutils import file_util

                self.execute(
                    file_util.write_file, (self.record, outputs),
                    "writing list of installed files to '%s'" %
                    self.record
                )
            self.warn_deprecated_options()
        finally:
            log.set_verbosity(self.distribution.verbose) 
開發者ID:sofia-netsurv,項目名稱:python-netsurv,代碼行數:24,代碼來源:easy_install.py

示例5: byte_compile

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def byte_compile(self, to_compile):
        if sys.dont_write_bytecode:
            self.warn('byte-compiling is disabled, skipping.')
            return

        from distutils.util import byte_compile

        try:
            # try to make the byte compile messages quieter
            log.set_verbosity(self.verbose - 1)

            byte_compile(to_compile, optimize=0, force=1, dry_run=self.dry_run)
            if self.optimize:
                byte_compile(
                    to_compile, optimize=self.optimize, force=1,
                    dry_run=self.dry_run,
                )
        finally:
            log.set_verbosity(self.verbose)  # restore original verbosity 
開發者ID:sofia-netsurv,項目名稱:python-netsurv,代碼行數:21,代碼來源:easy_install.py

示例6: run

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def run(self):
        if self.verbose != self.distribution.verbose:
            log.set_verbosity(self.verbose)
        try:
            for spec in self.args:
                self.easy_install(spec, not self.no_deps)
            if self.record:
                outputs = self.outputs
                if self.root:               # strip any package prefix
                    root_len = len(self.root)
                    for counter in range(len(outputs)):
                        outputs[counter] = outputs[counter][root_len:]
                from distutils import file_util
                self.execute(
                    file_util.write_file, (self.record, outputs),
                    "writing list of installed files to '%s'" %
                    self.record
                )
            self.warn_deprecated_options()
        finally:
            log.set_verbosity(self.distribution.verbose) 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:23,代碼來源:easy_install.py

示例7: build_and_install

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def build_and_install(self, setup_script, setup_base):
        args = ['bdist_egg', '--dist-dir']

        dist_dir = tempfile.mkdtemp(
            prefix='egg-dist-tmp-', dir=os.path.dirname(setup_script)
        )
        try:
            self._set_fetcher_options(os.path.dirname(setup_script))
            args.append(dist_dir)

            self.run_setup(setup_script, setup_base, args)
            all_eggs = Environment([dist_dir])
            eggs = []
            for key in all_eggs:
                for dist in all_eggs[key]:
                    eggs.append(self.install_egg(dist.location, setup_base))
            if not eggs and not self.dry_run:
                log.warn("No eggs found in %s (setup script problem?)",
                    dist_dir)
            return eggs
        finally:
            rmtree(dist_dir)
            log.set_verbosity(self.verbose) # restore our log verbosity 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:25,代碼來源:easy_install.py

示例8: byte_compile

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def byte_compile(self, to_compile):
        if _dont_write_bytecode:
            self.warn('byte-compiling is disabled, skipping.')
            return

        from distutils.util import byte_compile
        try:
            # try to make the byte compile messages quieter
            log.set_verbosity(self.verbose - 1)

            byte_compile(to_compile, optimize=0, force=1, dry_run=self.dry_run)
            if self.optimize:
                byte_compile(
                    to_compile, optimize=self.optimize, force=1,
                    dry_run=self.dry_run
                )
        finally:
            log.set_verbosity(self.verbose)     # restore original verbosity 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:20,代碼來源:easy_install.py

示例9: byte_compile

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def byte_compile(self, to_compile):
        if sys.dont_write_bytecode:
            return

        from distutils.util import byte_compile

        try:
            # try to make the byte compile messages quieter
            log.set_verbosity(self.verbose - 1)

            byte_compile(to_compile, optimize=0, force=1, dry_run=self.dry_run)
            if self.optimize:
                byte_compile(
                    to_compile, optimize=self.optimize, force=1,
                    dry_run=self.dry_run,
                )
        finally:
            log.set_verbosity(self.verbose)  # restore original verbosity 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:20,代碼來源:easy_install.py

示例10: byte_compile

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import set_verbosity [as 別名]
def byte_compile(self, to_compile):
        if _dont_write_bytecode:
            self.warn('byte-compiling is disabled, skipping.')
            return

        from distutils.util import byte_compile

        try:
            # try to make the byte compile messages quieter
            log.set_verbosity(self.verbose - 1)

            byte_compile(to_compile, optimize=0, force=1, dry_run=self.dry_run)
            if self.optimize:
                byte_compile(
                    to_compile, optimize=self.optimize, force=1,
                    dry_run=self.dry_run
                )
        finally:
            log.set_verbosity(self.verbose)  # restore original verbosity 
開發者ID:aliyun,項目名稱:oss-ftp,代碼行數:21,代碼來源:easy_install.py


注:本文中的distutils.log.set_verbosity方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。