From 39fb254e019c920516bb317d4b48a8de7cac850e Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 28 Jan 2023 15:57:20 +0000 Subject: Fix the type annotations --- libmat2/epub.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libmat2/epub.py') diff --git a/libmat2/epub.py b/libmat2/epub.py index 7613d35..3c5046a 100644 --- a/libmat2/epub.py +++ b/libmat2/epub.py @@ -3,10 +3,11 @@ import re import uuid import zipfile import xml.etree.ElementTree as ET # type: ignore -from typing import Any +from typing import Any, Dict from . import archive, office + class EPUBParser(archive.ZipParser): mimetypes = {'application/epub+zip', } metadata_namespace = '{http://purl.org/dc/elements/1.1/}' @@ -28,7 +29,6 @@ class EPUBParser(archive.ZipParser): })) self.uniqid = uuid.uuid4() - def is_archive_valid(self): super().is_archive_valid() with zipfile.ZipFile(self.filename) as zin: @@ -37,7 +37,7 @@ class EPUBParser(archive.ZipParser): if member_name.endswith('META-INF/encryption.xml'): raise ValueError('the file contains encrypted fonts') - def _specific_get_meta(self, full_path, file_path) -> dict[str, Any]: + def _specific_get_meta(self, full_path, file_path) -> Dict[str, Any]: if not file_path.endswith('.opf'): return {} @@ -73,7 +73,6 @@ class EPUBParser(archive.ZipParser): short_empty_elements=False) return True - def __handle_tocncx(self, full_path: str) -> bool: try: tree, namespace = office._parse_xml(full_path) -- cgit v1.3