from .directory import Directory from .artist import Artist from pathlib import Path from log import Log class Root(Directory): def __init__(self, path: Path, log: Log): super().__init__(path, log, 'ROOT') def populate(self, log: Log) -> list: contents = list() for e in self.path.iterdir(): if e.is_file(): self.log.warning('POP', f"File {e} ignored.") elif e.is_dir(): contents.append(Artist(e, log)) return contents