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


Python utils.printdbg函数代码示例

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


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

示例1: __reader

    def __reader(self, templog, queue):
        def commit_cb(item):
            queue.put(item)

        printdbg("DBProxyContentHandler: thread __reader started")
        templog.foreach(commit_cb, self.order)
        printdbg("DBProxyContentHandler: thread __reader finished")
开发者ID:Lashchyk,项目名称:CVSAnalY,代码行数:7,代码来源:DBProxyContentHandler.py

示例2: __load_caches_from_disk

 def __load_caches_from_disk(self):
     printdbg("DBContentHandler: Loading caches from disk (%s)", (self.cache_file,))
     f = open(self.cache_file, 'r')
     (self.file_cache, self.moves_cache, self.deletes_cache,
      self.revision_cache, self.branch_cache, self.tags_cache,
      self.people_cache) = load(f)
     f.close()
开发者ID:linzhp,项目名称:CVSAnalY,代码行数:7,代码来源:DBContentHandler.py

示例3: ensure_person

        def ensure_person(person):
            profiler_start("Ensuring person %s for repository %d",
                            (person.name, self.repo_id))
            printdbg("DBContentHandler: ensure_person %s <%s>",
                      (person.name, person.email))
            cursor = self.cursor

            name = to_utf8(person.name)
            email = person.email

            if email is not None:
                email = to_utf8(email).decode("utf-8")

            cursor.execute(statement(
                "SELECT id from people where name = ?", self.db.place_holder),
                (to_utf8(name).decode("utf-8"),))
            rs = cursor.fetchone()
            if not rs:
                p = DBPerson(None, person)

                cursor.execute(statement(DBPerson.__insert__,
                                self.db.place_holder),
                                (p.id, to_utf8(p.name).decode("utf-8"),
                                 email))
                person_id = p.id
            else:
                person_id = rs[0]

            profiler_stop("Ensuring person %s for repository %d",
                           (person.name, self.repo_id), True)

            return person_id
开发者ID:apepper,项目名称:cvsanaly,代码行数:32,代码来源:DBContentHandler.py

示例4: _get_uri_and_repo

def _get_uri_and_repo(path):
    """ Get a URI and repositoryhandler object for a path.

    This function returns a URI as a string, and the repositoryhandler
    object that represents that URI. They are returned together as a tuple.

    Args:
      path: The path to the repository
    """
    # Create repository
    if path is not None:
        try:
            printdbg("Creating repositoryhandler instance")
            repo = create_repository_from_path(path)
            repo.timeout = 120
        except RepositoryUnknownError:
            printerr("Path %s doesn't seem to point to a repository " + \
                     "supported by cvsanaly", (path,))
            sys.exit(1)
        except Exception, e:
            printerr("Unknown error creating repository for path %s (%s)",
                     (path, str(e)))
            sys.exit(1)
        uri = repo.get_uri_for_path(path)
        return (uri, repo)
开发者ID:ProjectHistory,项目名称:MininGit,代码行数:25,代码来源:main.py

示例5: __save_caches_to_disk

 def __save_caches_to_disk(self):
     printdbg("DBContentHandler: Saving caches to disk (%s)", (self.cache_file,))
     cache = [self.file_cache, self.moves_cache, self.deletes_cache,
              self.revision_cache, self.branch_cache, self.tags_cache,
              self.people_cache]
     f = open(self.cache_file, 'w')
     dump(cache, f, -1)
     f.close()
开发者ID:linzhp,项目名称:CVSAnalY,代码行数:8,代码来源:DBContentHandler.py

示例6: _get_extensions_manager

def _get_extensions_manager(extensions, hard_order=False):
    try:
        printdbg("Starting ExtensionsManager")
        emg = ExtensionsManager(extensions,
                                hard_order=hard_order)
        return emg
    except InvalidExtension, e:
        printerr("Invalid extension %s", (e.name,))
        sys.exit(1)
开发者ID:ProjectHistory,项目名称:MininGit,代码行数:9,代码来源:main.py

示例7: __execute

    def __execute (self):
        q = "%s LIMIT %d OFFSET %d" % (self.query, self.interval_size, self.i)
        self.i += self.interval_size

        printdbg (q)
        if self.args:
            self.cursor.execute (q, self.args)
        else:
            self.cursor.execute (q)

        self.need_exec = False
开发者ID:achernet,项目名称:CVSAnalY,代码行数:11,代码来源:Database.py

示例8: end

    def end(self):
        # flush pending inserts
        printdbg("DBContentHandler: flushing pending inserts")
        self.__insert_many()

        # Save the caches to disk
        profiler_start("Saving caches to disk")
        self.__save_caches_to_disk()
        profiler_stop("Saving caches to disk", delete=True)

        self.cursor.close()
        self.cnn.close()
        self.cnn = None
开发者ID:apepper,项目名称:cvsanaly,代码行数:13,代码来源:DBContentHandler.py

示例9: statement

def statement(str, ph_mark):
    if "?" == ph_mark or "?" not in str:
        printdbg(str)
        return str

    tokens = str.split("'")
    for i in range(0, len(tokens), 2):
        tokens[i] = tokens[i].replace("?", ph_mark)

    retval = "'".join(tokens)
    printdbg(retval)
    
    return retval
开发者ID:apepper,项目名称:cvsanaly,代码行数:13,代码来源:Database.py

示例10: ensure_tag

        def ensure_tag(tag):
            profiler_start("Ensuring tag %s for repository %d", (tag, self.repo_id))
            printdbg("DBContentHandler: ensure_tag %s", (tag,))
            cursor = self.cursor

            cursor.execute(statement("SELECT id from tags where name = ?", self.db.place_holder), (tag,))
            rs = cursor.fetchone()
            if not rs:
                t = DBTag(None, tag)
                cursor.execute(statement(DBTag.__insert__, self.db.place_holder), (t.id, t.name))
                tag_id = t.id
            else:
                tag_id = rs[0]

            profiler_stop("Ensuring tag %s for repository %d", (tag, self.repo_id), True)

            return tag_id
开发者ID:shakhat,项目名称:scm-analytics,代码行数:17,代码来源:DBContentHandler.py

示例11: ensure_branch

        def ensure_branch(branch):
            profiler_start("Ensuring branch %s for repository %d", (branch, self.repo_id))
            printdbg("DBContentHandler: ensure_branch %s", (branch,))
            cursor = self.cursor

            cursor.execute(statement("SELECT id from branches where name = ?", self.db.place_holder), (branch,))
            rs = cursor.fetchone()
            if not rs:
                b = DBBranch(None, branch)
                cursor.execute(statement(DBBranch.__insert__, self.db.place_holder), (b.id, b.name))
                branch_id = b.id
            else:
                branch_id = rs[0]

            profiler_stop("Ensuring branch %s for repository %d", (branch, self.repo_id), True)

            return branch_id
开发者ID:shakhat,项目名称:scm-analytics,代码行数:17,代码来源:DBContentHandler.py

示例12: __get_file_from_moves_cache

    def __get_file_from_moves_cache(self, path):
        # Path is not in the cache, but it should
        # Look if any of its parents was moved
        printdbg("DBContentHandler: looking for path %s in moves cache", (path,))
        current_path = path
        replaces = []
        while current_path not in self.file_cache:
            found = False
            for new_path in self.moves_cache.keys():
                if not current_path.startswith(new_path) or new_path in replaces:
                    continue

                current_path = current_path.replace(new_path, self.moves_cache[new_path], 1)
                replaces.append(new_path)
                found = True

            if not found:
                raise FileNotInCache

        return self.file_cache[current_path]
开发者ID:linzhp,项目名称:CVSAnalY,代码行数:20,代码来源:DBContentHandler.py

示例13: __convert_commit_actions

    def __convert_commit_actions(self, commit):
        # We detect here files that have been moved or
        # copied. Files moved are converted into a
        # single action of type 'V'. For copied files
        # we just change its actions type from 'A' to 'C'

        def find_action(actions, type, path):
            for action in actions:
                if action.type == type and action.f1 == path:
                    return action
            
            return None

        remove_actions = []
        
        for action in commit.actions:
            if action.f2 is not None:
                # Move or copy action
                if action.type == 'A':
                    del_action = find_action(commit.actions, 'D', action.f2)
                    if del_action is not None and del_action \
                    not in remove_actions:
                        # FIXME: See http://goo.gl/eymoH
                        printdbg("SVN Parser: File %s has been renamed to %s", 
                                 (action.f2, action.f1))
                        action.type = 'V'
                        remove_actions.append(del_action)
                    else:
                        action.type = 'C'
                        printdbg("SVN Parser: File %s has been copied to %s", 
                                 (action.f2, action.f1))

                        # Try to guess if it was a tag
                        # Yes, with svn we are always guessing :-/
                        tag = self.__guess_tag_from_path(action.f1)
                        if tag is not None:
                            if commit.tags is None:
                                commit.tags = []

                            commit.tags.append(tag)
                            
                elif action.type == 'R':
                    # TODO
                    printdbg("SVN Parser: File %s replaced to %s", 
                             (action.f2, action.f1))
                    pass

        for action in remove_actions:
            printdbg("SVN Parser: Removing action %s %s", 
                     (action.type, action.f1))
            commit.actions.remove(action)
开发者ID:ProjectHistory,项目名称:MininGit,代码行数:51,代码来源:SVNParser.py

示例14: do_delete

 def do_delete(self, delete_statement, params=None,
               error_message="Delete failed, data needs manual cleanup"):
     if self.repo_id is None:
         # Repo wasn't found anyway, so continue
         return True
     
     # You can't reference instance variables in default
     # parameters, so I have to do this.
     if params is None:
         params = (self.repo_id,)
     
     try:
         delete_cursor = self.connection.cursor()
         execute_statement(statement(delete_statement, 
                                     self.db.place_holder),
                           params, delete_cursor,
                           self.db, error_message)
     except Exception:
         printdbg("Deletion exception")
     finally:
         delete_cursor.close()
开发者ID:ProjectHistory,项目名称:MininGit,代码行数:21,代码来源:DBDeletionHandler.py

示例15: ensure_path

        def ensure_path(path, commit_id):
            profiler_start("Ensuring path %s for repository %d",
                           (path, self.repo_id))
            printdbg("DBContentHandler: ensure_path %s", (path,))

            prefix, lpath = path.split("://", 1)
            prefix += "://"
            tokens = lpath.strip('/').split('/')

            parent = -1
            node_id = None
            for i, token in enumerate(tokens):
                rpath = prefix + '/' + '/'.join(tokens[:i + 1])
                if not ":///" in path:
                    # If the repo paths don't start with /
                    # remove it here
                    rpath = rpath.replace(':///', '://')
                printdbg("DBContentHandler: rpath: %s", (rpath,))
                try:
                    node_id, parent_id = self.file_cache[rpath]
                    parent = node_id
                    continue
                except:
                    pass

                # Rpath not in cache, add it
                node_id = self.__add_new_file_and_link(token, parent,
                                                       commit_id)
                parent_id = parent
                parent = node_id

                # Also add to file_paths
                self.__add_file_path(commit_id, node_id,
                    re.sub('^\d+://', '', rpath))

                self.file_cache[rpath] = (node_id, parent_id)

            assert node_id is not None

            printdbg("DBContentHandler: path ensured %s = %d (%d)",
                     (path, node_id, parent_id))
            profiler_stop("Ensuring path %s for repository %d",
                          (path, self.repo_id), True)

            return node_id, parent_id
开发者ID:apepper,项目名称:cvsanaly,代码行数:45,代码来源:DBContentHandler.py


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