Ejemplo n.º 1
0
class Find(object):

    def __init__(self, root_path, factory=Path):
        self._path = Path(root_path)
        self._factory = factory

    def __iter__(self):
       for path, dirs, files in os.walk(self._path.absolute()):
           for filename in files:
               yield self._factory(os.path.join(path, filename))
Ejemplo n.º 2
0
 def __init__(self, path):
     self._shared_library_factory = UniqueFactory(self.SharedLibrary)
     self._executable_factory = UniqueFactory(self.Executable)
     path = Path(path)
     self._init_pre()
     if path.is_dir():
         self._root_path = path
         self._init_binaries()
     else:
         root_path, filename = os.path.split(path.absolute())
         self._root_path = Path(root_path)
         self._init_binary(path)
     self._init_dependents()
     self._init_post()
     self._init_links()