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):
|
def __init__(self, path: Path, log: Log):
|
||||||
super().__init__(path, log, 'ALB')
|
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:
|
def populate(self, log: Log) -> list:
|
||||||
contents = list()
|
contents = list()
|
||||||
for e in self.path.iterdir():
|
for e in self.path.iterdir():
|
||||||
|
|
|
@ -30,6 +30,14 @@ class Directory(ABC):
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
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
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.path.name
|
return self.path.name
|
||||||
|
|
Loading…
Reference in New Issue
Block a user