retrieve files from cascading subdirs
This commit is contained in:
parent
7fdb28d965
commit
502e3a08da
|
@ -7,6 +7,11 @@ class Album(Directory):
|
|||
def __init__(self, path: Path, log: Log):
|
||||
super().__init__(path, log, 'ALB')
|
||||
|
||||
@property
|
||||
def all_files(self) -> list:
|
||||
# todo: handle unexpected dirs
|
||||
return [file.path for file in self.contents]
|
||||
|
||||
def populate(self, log: Log) -> list:
|
||||
contents = list()
|
||||
for e in self.path.iterdir():
|
||||
|
|
|
@ -30,6 +30,14 @@ class Directory(ABC):
|
|||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
@property
|
||||
def all_files(self) -> list:
|
||||
files = list()
|
||||
for c in self:
|
||||
# todo: handle unexpected files
|
||||
files += c.all_files()
|
||||
return files
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.path.name
|
||||
|
|
Loading…
Reference in New Issue
Block a user