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)
|
self.contents = self.populate(log)
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return self.contents.__iter__()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
return self.path.name
|
return self.path.name
|
||||||
|
|
||||||
|
def by_name(self):
|
||||||
|
return [e.name for e in self.contents]
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def populate(self, log: Log) -> list:
|
def populate(self, log: Log) -> list:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
Loading…
Reference in New Issue
Block a user