Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions mimeDataExtras.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[
{
"name": "application/vnd.ms-outlook",
"description": "Microsoft Outlook message format.",
"links": {
"deprecates": [],
"relatedTo": [],
"parentOf": [],
"alternativeTo": []
},
"fileTypes": [
".msg"
],
"furtherReading": [],
"notices": {
"hasNoOfficial": false,
"communityContributed": true,
"popularUsage": null
}
},
{
"name": "application/vnd.ms-outlook-pst",
"description": "Microsoft Outlook personal storage table (PST) archive.",
"links": {
"deprecates": [],
"relatedTo": [],
"parentOf": [],
"alternativeTo": []
},
"fileTypes": [
".pst"
],
"furtherReading": [],
"notices": {
"hasNoOfficial": false,
"communityContributed": true,
"popularUsage": null
}
}
]
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dev = [
"mkdocs-material>=8.5.10",
"mkdocstrings[python]>=0.26.1",
"marimo>=0.15.2",
"python-magic @ git+https://github.com/ddelange/python-magic.git@0.4.28.post9"
]

[build-system]
Expand Down Expand Up @@ -93,6 +94,7 @@ ignore = [
"E501",
# DoNotAssignLambda
"E731",
"TRY003"
]

[tool.ruff.lint.per-file-ignores]
Expand Down
4 changes: 2 additions & 2 deletions src/mime_enum/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ def parse(value: str) -> MimeType:
MimeType.APPLICATION_JSON
"""
if not value:
raise ValueError("Empty MIME string") # noqa: TRY003
raise ValueError("Empty MIME string")
core = _strip_params(value)
if core in _ALIASES:
return _ALIASES[core]
try:
return MimeType(core)
except ValueError as exc:
raise ValueError(f"Unknown MIME type: {value!r}") from exc # noqa: TRY003
raise ValueError(f"Unknown MIME type: {value!r}") from exc


def try_parse(value: str) -> MimeType | None:
Expand Down
4 changes: 4 additions & 0 deletions src/mime_enum/mimetype.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ def __new__(cls, value: str, extensions: tuple[str, ...] = ()): # type: ignore[
APPLICATION_VND_MS_HTMLHELP = ("application/vnd.ms-htmlhelp", ("chm",))
APPLICATION_VND_MS_IMS = ("application/vnd.ms-ims", ("ims",))
APPLICATION_VND_MS_LRM = ("application/vnd.ms-lrm", ("lrm",))
APPLICATION_VND_MS_OUTLOOK = ("application/vnd.ms-outlook", ("msg",))
APPLICATION_VND_MS_OUTLOOK_PST = ("application/vnd.ms-outlook-pst", ("pst",))
APPLICATION_VND_MS_PKI_SECCAT = ("application/vnd.ms-pki.seccat", ("cat",))
APPLICATION_VND_MS_PKI_STL = ("application/vnd.ms-pki.stl", ("stl",))
APPLICATION_VND_MS_POWERPOINT = ("application/vnd.ms-powerpoint", ("pot", "ppa", "pps", "ppt", "pwz"))
Expand Down Expand Up @@ -1346,6 +1348,7 @@ def __new__(cls, value: str, extensions: tuple[str, ...] = ()): # type: ignore[
"mseed": MimeType("application/vnd.fdsn.mseed"),
"mseq": MimeType("application/vnd.mseq"),
"msf": MimeType("application/vnd.epson.msf"),
"msg": MimeType("application/vnd.ms-outlook"),
"msh": MimeType("model/mesh"),
"msi": MimeType("application/x-msdownload"),
"msl": MimeType("application/vnd.mobius.msl"),
Expand Down Expand Up @@ -1481,6 +1484,7 @@ def __new__(cls, value: str, extensions: tuple[str, ...] = ()): # type: ignore[
"psb": MimeType("application/vnd.3gpp.pic-bw-small"),
"psd": MimeType("image/vnd.adobe.photoshop"),
"psf": MimeType("application/x-font-linux-psf"),
"pst": MimeType("application/vnd.ms-outlook-pst"),
"ptid": MimeType("application/vnd.pvi.ptid1"),
"ptx": MimeType("image/x-pentax-pef"),
"pub": MimeType("application/x-mspublisher"),
Expand Down
Loading
Loading