Ejemplo n.º 1
0
 def loadCompressionInfo(self, binfile):
     binfile.seek(self.offset)
     self.compr_object = compression.chuunicomp()
     try:
         self.compr_object.fromBinfile(binfile)
     except compression.BadMagicNum as e:
         print("Warning: bad magic sequence (%x) in file %s" % (int(str(e)), self.name))
Ejemplo n.º 2
0
 def createFromFile(self, name, filepath, compress=True, adjust_separator=True):
     if adjust_separator:
         self.name = adjustSeparatorForPac(name)
     else:
         self.name = name
     self.size = os.path.getsize(filepath)
     self.import_from = filepath
     if compress > 0:
         self.compressed = True
         self.compr_object = compression.chuunicomp()
         self.compr_object.fromFutureImport(math.ceil(self.size / self.compr_object.default_chunksize))