1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 14:41:39 +00:00

Fixed folder scanning in SE, which was completely broken

Oops
This commit is contained in:
Virgil Dupras
2013-08-18 20:50:31 -04:00
parent 7e8f9036d8
commit be8efea081
5 changed files with 37 additions and 30 deletions

View File

@@ -53,6 +53,7 @@ class Directories:
self._dirs = []
self.states = {}
self.fileclasses = fileclasses
self.folderclass = fs.Folder
def __contains__(self, path):
for p in self._dirs:
@@ -163,7 +164,7 @@ class Directories:
Returned folders also have their ``is_ref`` attr set if applicable.
"""
for path in self._dirs:
from_folder = fs.Folder(path)
from_folder = self.folderclass(path)
for folder in self._get_folders(from_folder, j):
yield folder

View File

@@ -221,7 +221,7 @@ class Folder(File):
if self._subfolders is None:
subpaths = [self.path + name for name in self.path.listdir()]
subfolders = [p for p in subpaths if not p.islink() and p.isdir()]
self._subfolders = [Folder(p) for p in subfolders]
self._subfolders = [self.__class__(p) for p in subfolders]
return self._subfolders
@classmethod
@@ -244,8 +244,6 @@ def get_file(path, fileclasses=[File]):
def get_files(path, fileclasses=[File]):
"""Returns a list of :class:`File` for each file contained in ``path``.
Subfolders are recursively scanned.
:param Path path: path to scan
:param fileclasses: List of candidate :class:`File` classes
"""