Commit 9a81b3ad authored by jvoisin's avatar jvoisin

Improve type annotation coverage

parent f1a071d4
Pipeline #19901 passed with stages
in 4 minutes and 4 seconds
......@@ -40,7 +40,7 @@ DEPENDENCIES = {
def check_dependencies() -> dict:
def check_dependencies() -> Dict[str, bool]:
ret = collections.defaultdict(bool) # type: Dict[str, bool]
ret['Exiftool'] = True if exiftool._get_exiftool_path() else False
......
......@@ -24,7 +24,7 @@ class ExiftoolParser(abstract.AbstractParser):
meta.pop(key, None)
return meta
def _lightweight_cleanup(self):
def _lightweight_cleanup(self) -> bool:
if os.path.exists(self.output_filename):
try:
# exiftool can't force output to existing files
......
......@@ -125,7 +125,7 @@ class PDFParser(abstract.AbstractParser):
return True
@staticmethod
def __parse_metadata_field(data: str) -> dict:
def __parse_metadata_field(data: str) -> Dict[str, str]:
metadata = {}
for (_, key, value) in re.findall(r"<(xmp|pdfx|pdf|xmpMM):(.+)>(.+)</\1:\2>", data, re.I):
metadata[key] = value
......
......@@ -24,7 +24,7 @@ class AVIParser(exiftool.ExiftoolParser):
'SampleRate', 'AvgBytesPerSec', 'BitsPerSample',
'Duration', 'ImageSize', 'Megapixels'}
def remove_all(self):
def remove_all(self) -> bool:
cmd = [_get_ffmpeg_path(),
'-i', self.filename, # input file
'-y', # overwrite existing output file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment