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


Python log.debug方法代碼示例

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


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

示例1: combine_paths

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def combine_paths(*args, **kws):
    """ Return a list of existing paths composed by all combinations of
        items from arguments.
    """
    r = []
    for a in args:
        if not a:
            continue
        if is_string(a):
            a = [a]
        r.append(a)
    args = r
    if not args:
        return []
    if len(args) == 1:
        result = reduce(lambda a, b: a + b, map(glob, args[0]), [])
    elif len(args) == 2:
        result = []
        for a0 in args[0]:
            for a1 in args[1]:
                result.extend(glob(os.path.join(a0, a1)))
    else:
        result = combine_paths(*(combine_paths(args[0], args[1]) + args[2:]))
    log.debug('(paths: %s)', ','.join(result))
    return result 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:27,代碼來源:system_info.py

示例2: save

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def save(self):
        """Write changed .pth file back to disk"""
        if not self.dirty:
            return

        rel_paths = list(map(self.make_relative, self.paths))
        if rel_paths:
            log.debug("Saving %s", self.filename)
            lines = self._wrap_lines(rel_paths)
            data = '\n'.join(lines) + '\n'

            if os.path.islink(self.filename):
                os.unlink(self.filename)
            with open(self.filename, 'wt') as f:
                f.write(data)

        elif os.path.exists(self.filename):
            log.debug("Deleting empty %s", self.filename)
            os.unlink(self.filename)

        self.dirty = False 
開發者ID:jpush,項目名稱:jbox,代碼行數:23,代碼來源:easy_install.py

示例3: copytree

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def copytree(self):
        # Copy the .egg-info tree to site-packages
        def skimmer(src, dst):
            # filter out source-control directories; note that 'src' is always
            # a '/'-separated path, regardless of platform.  'dst' is a
            # platform-specific path.
            for skip in '.svn/', 'CVS/':
                if src.startswith(skip) or '/' + skip in src:
                    return None
            if self.install_layout and self.install_layout in ['deb'] and src.startswith('SOURCES.txt'):
                log.info("Skipping SOURCES.txt")
                return None
            self.outputs.append(dst)
            log.debug("Copying %s to %s", src, dst)
            return dst

        unpack_archive(self.source, self.target, skimmer) 
開發者ID:sofia-netsurv,項目名稱:python-netsurv,代碼行數:19,代碼來源:install_egg_info.py

示例4: debug_print

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def debug_print(self, msg):
        """Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        """
        from distutils.debug import DEBUG
        if DEBUG:
            print msg
            sys.stdout.flush()


    # -- Option validation methods -------------------------------------
    # (these are very handy in writing the 'finalize_options()' method)
    #
    # NB. the general philosophy here is to ensure that a particular option
    # value meets certain type and value constraints.  If not, we try to
    # force it into conformance (eg. if we expect a list but have a string,
    # split the string on comma and/or whitespace).  If we can't force the
    # option into conformance, raise DistutilsOptionError.  Thus, command
    # classes need do nothing more than (eg.)
    #   self.ensure_string_list('foo')
    # and they can be guaranteed that thereafter, self.foo will be
    # a list of strings. 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:24,代碼來源:cmd.py

示例5: find_library_file

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def find_library_file (self, dirs, lib, debug=0):
        # Prefer a debugging library if found (and requested), but deal
        # with it if we don't have one.
        if debug:
            try_names = [lib + "_d", lib]
        else:
            try_names = [lib]
        for dir in dirs:
            for name in try_names:
                libfile = os.path.join(dir, self.library_filename (name))
                if os.path.exists(libfile):
                    return libfile
        else:
            # Oops, didn't find it in *any* of 'dirs'
            return None

    # find_library_file ()

    # Helper methods for using the MSVC registry settings 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:21,代碼來源:msvccompiler.py

示例6: create_static_lib

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def create_static_lib(self, objects, output_libname,
                          output_dir=None, debug=0, target_lang=None):
        objects, output_dir = self._fix_object_args(objects, output_dir)

        output_filename = \
            self.library_filename(output_libname, output_dir=output_dir)

        if self._need_link(objects, output_filename):
            self.mkpath(os.path.dirname(output_filename))
            self.spawn(self.archiver +
                       [output_filename] +
                       objects + self.objects)

            # Not many Unices required ranlib anymore -- SunOS 4.x is, I
            # think the only major Unix that does.  Maybe we need some
            # platform intelligence here to skip ranlib if it's not
            # needed -- or maybe Python's configure script took care of
            # it for us, hence the check for leading colon.
            if self.ranlib:
                try:
                    self.spawn(self.ranlib + [output_filename])
                except DistutilsExecError, msg:
                    raise LibError, msg 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:25,代碼來源:unixccompiler.py

示例7: create_static_lib

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def create_static_lib (self,
                           objects,
                           output_libname,
                           output_dir=None,
                           debug=0,
                           target_lang=None):

        (objects, output_dir) = self._fix_object_args (objects, output_dir)
        output_filename = \
            self.library_filename (output_libname, output_dir=output_dir)

        if self._need_link (objects, output_filename):
            lib_args = [output_filename, '/u'] + objects
            if debug:
                pass                    # XXX what goes here?
            try:
                self.spawn ([self.lib] + lib_args)
            except DistutilsExecError, msg:
                raise LibError, msg 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:21,代碼來源:bcppcompiler.py

示例8: initialize_options

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def initialize_options (self):
        self.extensions = None
        self.build_lib = None
        self.plat_name = None
        self.build_temp = None
        self.inplace = 0
        self.package = None

        self.include_dirs = None
        self.define = None
        self.undef = None
        self.libraries = None
        self.library_dirs = None
        self.rpath = None
        self.link_objects = None
        self.debug = None
        self.force = None
        self.compiler = None
        self.swig = None
        self.swig_cpp = None
        self.swig_opts = None
        self.user = None 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:24,代碼來源:build_ext.py

示例9: _spawn_os2

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def _spawn_os2(cmd, search_path=1, verbose=0, dry_run=0):
    executable = cmd[0]
    if search_path:
        # either we find one or it stays the same
        executable = find_executable(executable) or executable
    log.info(' '.join([executable] + cmd[1:]))
    if not dry_run:
        # spawnv for OS/2 EMX requires a full path to the .exe
        try:
            rc = os.spawnv(os.P_WAIT, executable, cmd)
        except OSError, exc:
            # this seems to happen when the command isn't found
            raise DistutilsExecError, \
                  "command '%s' failed: %s" % (cmd[0], exc[-1])
        if rc != 0:
            # and this reflects the command running but failing
            log.debug("command '%s' failed with exit status %d" % (cmd[0], rc))
            raise DistutilsExecError, \
                  "command '%s' failed with exit status %d" % (cmd[0], rc) 
開發者ID:glmcdona,項目名稱:meddle,代碼行數:21,代碼來源:spawn.py

示例10: process_filename

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def process_filename(self, fn, nested=False):
        # process filenames or directories
        if not os.path.exists(fn):
            self.warn("Not found: %s", fn)
            return

        if os.path.isdir(fn) and not nested:
            path = os.path.realpath(fn)
            for item in os.listdir(path):
                self.process_filename(os.path.join(path,item), True)

        dists = distros_for_filename(fn)
        if dists:
            self.debug("Found: %s", fn)
            list(map(self.add, dists)) 
開發者ID:jpush,項目名稱:jbox,代碼行數:17,代碼來源:package_index.py

示例11: obtain

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def obtain(self, requirement, installer=None):
        self.prescan()
        self.find_packages(requirement)
        for dist in self[requirement.key]:
            if dist in requirement:
                return dist
            self.debug("%s does not match %s", requirement, dist)
        return super(PackageIndex, self).obtain(requirement,installer) 
開發者ID:jpush,項目名稱:jbox,代碼行數:10,代碼來源:package_index.py

示例12: check_hash

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def check_hash(self, checker, filename, tfp):
        """
        checker is a ContentChecker
        """
        checker.report(self.debug,
            "Validating %%s checksum for %s" % filename)
        if not checker.is_valid():
            tfp.close()
            os.unlink(filename)
            raise DistutilsError(
                "%s validation failed for %s; "
                "possible download problem?" % (
                                checker.hash.name, os.path.basename(filename))
            ) 
開發者ID:jpush,項目名稱:jbox,代碼行數:16,代碼來源:package_index.py

示例13: debug

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def debug(self, msg, *args):
        log.debug(msg, *args) 
開發者ID:jpush,項目名稱:jbox,代碼行數:4,代碼來源:package_index.py

示例14: zap_pyfiles

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def zap_pyfiles(self):
        log.info("Removing .py files from temporary directory")
        for base, dirs, files in walk_egg(self.bdist_dir):
            for name in files:
                if name.endswith('.py'):
                    path = os.path.join(base, name)
                    log.debug("Deleting %s", path)
                    os.unlink(path) 
開發者ID:jpush,項目名稱:jbox,代碼行數:10,代碼來源:bdist_egg.py

示例15: make_zipfile

# 需要導入模塊: from distutils import log [as 別名]
# 或者: from distutils.log import debug [as 別名]
def make_zipfile(zip_filename, base_dir, verbose=0, dry_run=0, compress=True,
                 mode='w'):
    """Create a zip file from all the files under 'base_dir'.  The output
    zip file will be named 'base_dir' + ".zip".  Uses either the "zipfile"
    Python module (if available) or the InfoZIP "zip" utility (if installed
    and found on the default search path).  If neither tool is available,
    raises DistutilsExecError.  Returns the name of the output zip file.
    """
    import zipfile

    mkpath(os.path.dirname(zip_filename), dry_run=dry_run)
    log.info("creating '%s' and adding '%s' to it", zip_filename, base_dir)

    def visit(z, dirname, names):
        for name in names:
            path = os.path.normpath(os.path.join(dirname, name))
            if os.path.isfile(path):
                p = path[len(base_dir) + 1:]
                if not dry_run:
                    z.write(path, p)
                log.debug("adding '%s'" % p)

    compression = zipfile.ZIP_DEFLATED if compress else zipfile.ZIP_STORED
    if not dry_run:
        z = zipfile.ZipFile(zip_filename, mode, compression=compression)
        for dirname, dirs, files in os.walk(base_dir):
            visit(z, dirname, files)
        z.close()
    else:
        for dirname, dirs, files in os.walk(base_dir):
            visit(None, dirname, files)
    return zip_filename 
開發者ID:jpush,項目名稱:jbox,代碼行數:34,代碼來源:bdist_egg.py


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