whatopus/src/dir/root.py
grglcy af908f51ca create dir package
- create classes for common directory types
2025-07-02 20:10:59 +01:00

18 lines
517 B
Python

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