Extend commands

This commit is contained in:
2022-09-07 21:36:09 +03:00
parent 013b33731b
commit 5d96b76541
12 changed files with 136 additions and 110 deletions

View File

@@ -1,6 +1,6 @@
import mimetypes
import os
from typing import Optional
from typing import Tuple, Optional
class ListGenerator:
@@ -36,10 +36,10 @@ class ListGenerator:
class _FileAttrs:
def __init__(self, name, path, _type, exc):
def __init__(self, name, path, type, exc):
self.name = name
self.path = path
self.mimetype = _type
self.mimetype = type
self.exc = exc
def __str__(self):
@@ -63,7 +63,7 @@ class _ListGenerationIter:
return self
@property
def _type(self) -> Optional[str]:
def type(self) -> tuple[Optional[str], Optional[str]]:
guess = mimetypes.guess_type(f'{self._path}/{self._list[self._current_index]}')[0]
return guess