optimised imports
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import mimetypes
|
||||
import os
|
||||
from mimetypes import guess_type
|
||||
from os import walk
|
||||
|
||||
|
||||
class ListGenerator:
|
||||
@@ -19,7 +19,7 @@ class ListGenerator:
|
||||
def _lister(cls, path) -> list:
|
||||
_list: list = []
|
||||
try:
|
||||
for f in os.walk(path):
|
||||
for f in walk(path):
|
||||
_list.extend(f)
|
||||
break
|
||||
return sorted(_list[2])
|
||||
@@ -63,7 +63,7 @@ class _ListGenerationIter:
|
||||
|
||||
@property
|
||||
def type(self) -> str:
|
||||
guess = mimetypes.guess_type(f'{self._path}/{self._list[self._current_index]}')[0]
|
||||
guess = guess_type(f'{self._path}/{self._list[self._current_index]}')[0]
|
||||
return guess
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user