Beispiel #1
0
    def __init__(self, path, strict=False):
        """
        :param path: Packed CCH file path
        """
        self.path = path
        self.parser = get_parser(self.path)(strict=strict)

        self.filename = path
        self.file = get_compressed_file(path)
Beispiel #2
0
 def __init__(self, path, strict=False):
     """
     :param path: Packed CCH file path
     """
     self.path = path
     self.parser = get_parser(self.path)(strict=strict)
     
     self.filename = path
     self.file = get_compressed_file(path)
Beispiel #3
0
 def __init__(self, path, fd=None, parser=None, strict=False):
     self.path = path
     self.resume_line_number = 0
     if parser is None:
         self.parser = get_parser(self.path)(strict=strict)
     else:
         self.parser = parser
     if fd is None:
         self.fd = open(path, 'r')
     else:
         self.fd = fd
Beispiel #4
0
 def __init__(self, path, fd=None, parser=None, strict=False):
     self.path = path
     self.resume_line_number = 0
     if parser is None:
         self.parser = get_parser(self.path)(strict=strict)
     else:
         self.parser = parser
     if fd is None:
         self.fd = open(path, 'r')
     else:
         self.fd = fd
Beispiel #5
0
 def __init__(self, path, fd=None, parser=None, strict=False):
     self.path = path
     self.resume_line_number = 0
     if parser is None:
         self.parser = get_parser(self.path)(strict=strict)
     else:
         self.parser = parser
     if fd is None:
         self.fd = open(path, 'r')
     else:
         try:
             # bz compressed files ina zip file
             data = bz2.decompress(fd.read())
             bzfd = StringIO()
             bzfd.write(data)
             self.fd = bzfd
         except Exception as e:
             self.fd = fd