Example #1
0
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
Example #2
0
    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
Example #3
0
File: zip.py Project: Taifxx/xxtrep
    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
Example #4
0
 def tvsf(self):
     return DOS.join(self.addon.libpath, self.libFolder,
                     self.addon.tvsFolder)
Example #5
0
 def mov(self):
     return DOS.join(self.addon.libpath, self.libFolder,
                     self.addon.movFolder)
Example #6
0
 def lib(self):
     return DOS.join(self.addon.libpath, self.libFolder)