gophermap 0.0.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gophermap
3
- Version: 0.0.3
3
+ Version: 0.0.4
4
4
  Summary: A simple library for parsng Gophermaps
5
5
  Keywords: Gopher,Gophermap,Hypertext,library,Markup,parser,Small Web,smolweb
6
6
  Author: Dave Pearson
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "gophermap"
3
- version = "0.0.3"
3
+ version = "0.0.4"
4
4
  description = "A simple library for parsng Gophermaps"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -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