示例#1
0
    def __init__(self, db):
        ContentHandler.__init__(self)

        self.db = db
        self.cnn = None
        self.cursor = None

        self.__init_caches()
示例#2
0
    def __init__(self, db):
        ContentHandler.__init__(self)

        self.db = db
        self.templog = None
        self.order = ContentHandler.ORDER_REVISION
        self.repo_uri = None

        self.db_handler = DBContentHandler(db)
示例#3
0
class Parser:

    CONTENT_ORDER = ContentHandler.ORDER_REVISION

    def __init__ (self):
        self.handler = ContentHandler ()
        self.repo_uri = None
        
        self.n_line = 0

    def set_content_handler (self, handler):
        self.handler = handler

    def set_repository (self, repo, uri):
        self.repo_uri = uri

    def flush (self):
        pass
        
    def _parse_line (self):
        raise NotImplementedError

    def feed (self, data):
        if self.n_line == 0:
            self.handler.begin (self.CONTENT_ORDER)

            if self.repo_uri is not None:
                self.handler.repository (self.repo_uri)
            
        for line in data.splitlines ():
            self.n_line += 1
            self._parse_line (line)

    def end (self):
        if self.n_line <= 0:
            return
        self.flush ()
        self.handler.end ()        
示例#4
0
    def __init__(self):
        self.handler = ContentHandler()
        self.repo_uri = None

        self.n_line = 0
示例#5
0
文件: Parser.py 项目: jsichi/cvsanaly
 def __init__ (self):
     self.handler = ContentHandler ()
     self.repo_uri = None
     
     self.n_line = 0