iterate contents directly
- provide list of names
This commit is contained in:
parent
63f6f99caa
commit
1c42269f92
|
@ -11,10 +11,16 @@ class Directory(ABC):
|
|||
|
||||
self.contents = self.populate(log)
|
||||
|
||||
def __iter__(self):
|
||||
return self.contents.__iter__()
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return self.path.name
|
||||
|
||||
def by_name(self):
|
||||
return [e.name for e in self.contents]
|
||||
|
||||
@abstractmethod
|
||||
def populate(self, log: Log) -> list:
|
||||
raise NotImplementedError
|
||||
|
|
Loading…
Reference in New Issue
Block a user