Logo Search packages:      
Sourcecode: hardlink version File versions  Download package

def hardlink::HardLink::get_files (   self  ) 

Return a dict like {'directory': [File(...)]}

Definition at line 194 of file hardlink.py.

00194                        :
        '''Return a dict like {'directory': [File(...)]}'''
        retfiles = defaultdict(list)
        for top in self._dirs:
            for root, _, files in os.walk(top):
                for fname in files:
                    fpath = os.path.join(root, fname)
                    exc = any(pat.search(fpath) for pat in self.opts.exclude)
                    inc = any(pat.search(fpath) for pat in self.opts.include)
                    if ((self.opts.exclude and exc and not inc) or
                        (self.opts.include and not inc)):
                        continue
                    try:
                        mfile = File(fpath, self.opts, self)
                        if mfile.isreg:
                            retfiles[mfile.hash].append(mfile)
                        del mfile
                    except OSError, err:
                        print 'OSError:', err
        return retfiles


def format(bytes):


Generated by  Doxygen 1.6.0   Back to index