Panda3D
Classes | Functions

Package pyinst.carchive_rt

Classes

class  CArchive
class  CTOC

Functions

def __getitem__
def find
def get
 def tobinary(self): import string entrylen = struct.calcsize(self.ENTRYSTRUCT) rslt = [] for (dpos, dlen, ulen, flag, typcd, nm) in self.data: nmlen = len(nm) + 1 # add 1 for a '\0' rslt.append(struct.pack(self.ENTRYSTRUCT+repr(nmlen)+'s', nmlen+entrylen, dpos, dlen, ulen, flag, typcd, nm+'\0')) return string.join(rslt, '')
def openEmbedded
 def add(self, entry): (nm, pathnm, flag, typcd) = entry[:4] if flag == 2: s = open(pathnm, 'r').read() s = s + '\0' else: s = open(pathnm, 'rb').read() ulen = len(s) if flag == 1: s = zlib.compress(s, self.LEVEL) dlen = len(s) where = self.lib.tell() if typcd == 'm': if strop.find(pathnm, '.__init__.py') > -1: typcd = 'M' self.toc.add(where, dlen, ulen, flag, typcd, nm) self.lib.write(s)

Function Documentation

def pyinst.carchive_rt.__getitem__ (   self,
  ndx 
)
def pyinst.carchive_rt.find (   self,
  name 
)
def pyinst.carchive_rt.get (   self,
  ndx 
)

def tobinary(self): import string entrylen = struct.calcsize(self.ENTRYSTRUCT) rslt = [] for (dpos, dlen, ulen, flag, typcd, nm) in self.data: nmlen = len(nm) + 1 # add 1 for a '\0' rslt.append(struct.pack(self.ENTRYSTRUCT+repr(nmlen)+'s', nmlen+entrylen, dpos, dlen, ulen, flag, typcd, nm+'\0')) return string.join(rslt, '')

def add(self, dpos, dlen, ulen, flag, typcd, nm): self.data.append(dpos, dlen, ulen, flag, typcd, nm)

def pyinst.carchive_rt.openEmbedded (   self,
  name 
)

def add(self, entry): (nm, pathnm, flag, typcd) = entry[:4] if flag == 2: s = open(pathnm, 'r').read() s = s + '\0' else: s = open(pathnm, 'rb').read() ulen = len(s) if flag == 1: s = zlib.compress(s, self.LEVEL) dlen = len(s) where = self.lib.tell() if typcd == 'm': if strop.find(pathnm, '.__init__.py') > -1: typcd = 'M' self.toc.add(where, dlen, ulen, flag, typcd, nm) self.lib.write(s)

def save_toc(self, tocpos): self.tocpos = tocpos tocstr = self.toc.tobinary() self.toclen = len(tocstr) self.lib.write(tocstr)

def save_trailer(self, tocpos): totallen = tocpos + self.toclen + self.TRLLEN trl = struct.pack(self.TRLSTRUCT, self.MAGIC, totallen, tocpos, self.toclen) self.lib.write(trl)

 All Classes Namespaces Functions Variables Properties