class libPaths: def __init__(self, addon, libFolder): self.addon = addon self.libFolder = libFolder @property def libpath(self): return self.addon.libpath @property def lib(self): return DOS.join(self.addon.libpath, self.libFolder) @property def mov(self): return DOS.join(self.addon.libpath, self.libFolder, self.addon.movFolder) @property def tvsf(self): return DOS.join(self.addon.libpath, self.libFolder, self.addon.tvsFolder) tvs = lambda self, path: DOS.join(self.tvsf, path) mov_name = lambda self: self.addon.movFolder tvs_name = lambda self: self.addon.tvsFolder
def zipdir(self, path, progress, ttl=Empty, template=Empty): flcount = 0 arch = [itm for itm in DOS.walk(path)] substep = 100.0 / len(arch) for root, dirs, files in arch: lenf = len(files) if lenf: stepv = substep / lenf else: progress.step(ttl, substep) for file in files: progress.step(ttl if ttl else file, stepv) if template and not self.isTempl(file, template): continue fullpath = DOS.join(root, file) base = fullpath.replace(path, Empty) self._zipfile.write(esys(de(fullpath)), esys(de(base))) flcount += 1 del progress return flcount
def zipdir(self, path, progress, ttl=Empty, template=Empty): flcount = 0 arch = [itm for itm in DOS.walk(path)] substep = 100.0 / len(arch) for root, dirs, files in arch: lenf = len(files) if lenf : stepv = substep / lenf else : progress.step(ttl, substep) for file in files: progress.step(ttl if ttl else file, stepv) if template and not self.isTempl(file, template) : continue fullpath = DOS.join(root, file) base = fullpath.replace(path, Empty) self._zipfile.write(esys(de(fullpath)), esys(de(base))) flcount += 1 del progress return flcount
def tvsf(self): return DOS.join(self.addon.libpath, self.libFolder, self.addon.tvsFolder)
def mov(self): return DOS.join(self.addon.libpath, self.libFolder, self.addon.movFolder)
def lib(self): return DOS.join(self.addon.libpath, self.libFolder)