added proper typing for mypy

Signed-off-by: Peter Staar <taa@zurich.ibm.com>
This commit is contained in:
Peter Staar 2024-11-16 08:04:17 +01:00
parent b8f1439880
commit bc31f2a973
2 changed files with 4 additions and 5 deletions

View File

@ -76,8 +76,7 @@ class MsExcelDocumentBackend(DeclarativeDocumentBackend):
origin = DocumentOrigin(
filename=self.file.name or "file",
# mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
mimetype="application/vnd.openxmlformats-officedocument.wordprocessingml.document",
mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
binary_hash=self.document_hash,
)

View File

@ -32,7 +32,7 @@ class InputFormat(str, Enum):
PDF = "pdf"
ASCIIDOC = "asciidoc"
MD = "md"
EXCEL = "excel"
XLSX = "xlsx"
class OutputFormat(str, Enum):
@ -50,7 +50,7 @@ FormatToExtensions: Dict[InputFormat, List[str]] = {
InputFormat.HTML: ["html", "htm", "xhtml"],
InputFormat.IMAGE: ["jpg", "jpeg", "png", "tif", "tiff", "bmp"],
InputFormat.ASCIIDOC: ["adoc", "asciidoc", "asc"],
InputFormat.EXCEL: ["xlsx"],
InputFormat.XLSX: ["xlsx"],
}
FormatToMimeType: Dict[InputFormat, List[str]] = {
@ -74,7 +74,7 @@ FormatToMimeType: Dict[InputFormat, List[str]] = {
InputFormat.PDF: ["application/pdf"],
InputFormat.ASCIIDOC: ["text/asciidoc"],
InputFormat.MD: ["text/markdown", "text/x-markdown"],
InputFormat.EXCEL: [
InputFormat.XLSX: [
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
],
}