Fix getFiles method on Directory
This commit is contained in:
parent
06f6f4ced6
commit
d6a5498fe1
1 changed files with 3 additions and 2 deletions
|
@ -56,7 +56,8 @@ class Directory:
|
|||
Returns:
|
||||
list: List of File objects for files within the Directory
|
||||
"""
|
||||
files = [f for f in os.listdir(self.location) if os.path.isfile]
|
||||
files = [f for f in os.listdir(self.location) if os.path.isfile(
|
||||
self.location / f) and os.path.getsize(self.location / f)]
|
||||
return [File(f, self) for f in files]
|
||||
|
||||
def getFile(self, name: str) -> Optional[File]:
|
||||
|
@ -72,4 +73,4 @@ class Directory:
|
|||
try:
|
||||
return File(name, self)
|
||||
except FileNotFoundError:
|
||||
return None
|
||||
return None
|
||||
|
|
Loading…
Reference in a new issue