xhtm 0.7__tar.gz → 0.8__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.
- {xhtm-0.7 → xhtm-0.8}/PKG-INFO +1 -1
- {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/PKG-INFO +1 -1
- {xhtm-0.7 → xhtm-0.8}/xhtml/attribute.py +1 -1
- {xhtm-0.7 → xhtm-0.8}/xhtml/header/headers.py +52 -0
- {xhtm-0.7 → xhtm-0.8}/LICENSE +0 -0
- {xhtm-0.7 → xhtm-0.8}/README.md +0 -0
- {xhtm-0.7 → xhtm-0.8}/setup.cfg +0 -0
- {xhtm-0.7 → xhtm-0.8}/setup.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/SOURCES.txt +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/dependency_links.txt +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/requires.txt +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/top_level.txt +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/zip-safe +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/__init__.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/element/__init__.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/element/attr.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/element/css.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/element/doc.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/element/tag.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/header/__init__.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/header/accept.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/header/content.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/locale/__init__.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/locale/template.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/resource/__init__.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/resource/favicon.ico +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/resource/logo.svg +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/template/__init__.py +0 -0
- {xhtm-0.7 → xhtm-0.8}/xhtml/template/hello.html +0 -0
{xhtm-0.7 → xhtm-0.8}/PKG-INFO
RENAMED
|
@@ -5,6 +5,58 @@ from typing import Dict
|
|
|
5
5
|
from typing import Iterator
|
|
6
6
|
|
|
7
7
|
|
|
8
|
+
class RequestLine():
|
|
9
|
+
"""HTTP requests
|
|
10
|
+
|
|
11
|
+
Reference:
|
|
12
|
+
https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Messages#http_requests
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def __init__(self, request_line: str):
|
|
16
|
+
method, target, protocol = request_line.split()
|
|
17
|
+
self.__protocol: str = protocol.strip()
|
|
18
|
+
self.__method: str = method.strip()
|
|
19
|
+
self.__target: str = target.strip()
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def protocol(self) -> str:
|
|
23
|
+
return self.__protocol
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def method(self) -> str:
|
|
27
|
+
return self.__method
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def target(self) -> str:
|
|
31
|
+
return self.__target
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class StatusLine():
|
|
35
|
+
"""HTTP responses
|
|
36
|
+
|
|
37
|
+
Reference:
|
|
38
|
+
https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Messages#http_responses
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
def __init__(self, status_line: str):
|
|
42
|
+
protocol, status_code, status_text = status_line.split(maxsplit=2)
|
|
43
|
+
self.__status_code: int = int(status_code.strip())
|
|
44
|
+
self.__status_text: str = status_text.strip()
|
|
45
|
+
self.__protocol: str = protocol.strip()
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def protocol(self) -> str:
|
|
49
|
+
return self.__protocol
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def status_code(self) -> int:
|
|
53
|
+
return self.__status_code
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def status_text(self) -> str:
|
|
57
|
+
return self.__status_text
|
|
58
|
+
|
|
59
|
+
|
|
8
60
|
class Headers(Enum):
|
|
9
61
|
"""HTTP headers
|
|
10
62
|
|
{xhtm-0.7 → xhtm-0.8}/LICENSE
RENAMED
|
File without changes
|
{xhtm-0.7 → xhtm-0.8}/README.md
RENAMED
|
File without changes
|
{xhtm-0.7 → xhtm-0.8}/setup.cfg
RENAMED
|
File without changes
|
{xhtm-0.7 → xhtm-0.8}/setup.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|