gophermap 0.0.2__tar.gz → 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {gophermap-0.0.2 → gophermap-0.0.4}/PKG-INFO +1 -1
- {gophermap-0.0.2 → gophermap-0.0.4}/pyproject.toml +1 -1
- {gophermap-0.0.2 → gophermap-0.0.4}/src/gophermap/item_type.py +29 -0
- gophermap-0.0.4/src/gophermap/py.typed +0 -0
- {gophermap-0.0.2 → gophermap-0.0.4}/README.md +0 -0
- {gophermap-0.0.2 → gophermap-0.0.4}/src/gophermap/__init__.py +0 -0
- {gophermap-0.0.2 → gophermap-0.0.4}/src/gophermap/__main__.py +0 -0
- {gophermap-0.0.2 → gophermap-0.0.4}/src/gophermap/exceptions.py +0 -0
- {gophermap-0.0.2 → gophermap-0.0.4}/src/gophermap/gopher_map.py +0 -0
- {gophermap-0.0.2 → gophermap-0.0.4}/src/gophermap/item.py +0 -0
|
@@ -65,5 +65,34 @@ class ItemType(StrEnum):
|
|
|
65
65
|
assert isinstance(value, str)
|
|
66
66
|
return ItemType.UNKNOWN
|
|
67
67
|
|
|
68
|
+
@property
|
|
69
|
+
def mime_type(self) -> str:
|
|
70
|
+
"""Get the MIME type for the item type.
|
|
71
|
+
|
|
72
|
+
Note:
|
|
73
|
+
This is a best-effort mapping and may not be accurate for all
|
|
74
|
+
item types.
|
|
75
|
+
"""
|
|
76
|
+
return {
|
|
77
|
+
ItemType.TEXT: "text/plain",
|
|
78
|
+
ItemType.MENU: "text/gopher-menu",
|
|
79
|
+
ItemType.CSO: "text/x-cso",
|
|
80
|
+
ItemType.ERROR: "text/x-error",
|
|
81
|
+
ItemType.BINHEX: "application/mac-binhex40",
|
|
82
|
+
ItemType.DOS_FILE: "application/octet-stream",
|
|
83
|
+
ItemType.UUENCODED: "application/x-uuencode",
|
|
84
|
+
ItemType.INDEX_SEARCH: "text/x-index-search",
|
|
85
|
+
ItemType.TELNET: "application/x-telnet",
|
|
86
|
+
ItemType.BINARY: "application/octet-stream",
|
|
87
|
+
ItemType.INFO: "text/plain",
|
|
88
|
+
ItemType.GIF: "image/gif",
|
|
89
|
+
ItemType.IMAGE: "application/octet-stream",
|
|
90
|
+
ItemType.HTML: "text/html",
|
|
91
|
+
ItemType.DOCUMENT: "application/octet-stream",
|
|
92
|
+
ItemType.AUDIO: "application/octet-stream",
|
|
93
|
+
ItemType.PDF: "application/pdf",
|
|
94
|
+
ItemType.XML: "application/xml",
|
|
95
|
+
}.get(self, "application/octet-stream")
|
|
96
|
+
|
|
68
97
|
|
|
69
98
|
### item_type.py ends here
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|