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.
Files changed (29) hide show
  1. {xhtm-0.7 → xhtm-0.8}/PKG-INFO +1 -1
  2. {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/PKG-INFO +1 -1
  3. {xhtm-0.7 → xhtm-0.8}/xhtml/attribute.py +1 -1
  4. {xhtm-0.7 → xhtm-0.8}/xhtml/header/headers.py +52 -0
  5. {xhtm-0.7 → xhtm-0.8}/LICENSE +0 -0
  6. {xhtm-0.7 → xhtm-0.8}/README.md +0 -0
  7. {xhtm-0.7 → xhtm-0.8}/setup.cfg +0 -0
  8. {xhtm-0.7 → xhtm-0.8}/setup.py +0 -0
  9. {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/SOURCES.txt +0 -0
  10. {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/dependency_links.txt +0 -0
  11. {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/requires.txt +0 -0
  12. {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/top_level.txt +0 -0
  13. {xhtm-0.7 → xhtm-0.8}/xhtm.egg-info/zip-safe +0 -0
  14. {xhtm-0.7 → xhtm-0.8}/xhtml/__init__.py +0 -0
  15. {xhtm-0.7 → xhtm-0.8}/xhtml/element/__init__.py +0 -0
  16. {xhtm-0.7 → xhtm-0.8}/xhtml/element/attr.py +0 -0
  17. {xhtm-0.7 → xhtm-0.8}/xhtml/element/css.py +0 -0
  18. {xhtm-0.7 → xhtm-0.8}/xhtml/element/doc.py +0 -0
  19. {xhtm-0.7 → xhtm-0.8}/xhtml/element/tag.py +0 -0
  20. {xhtm-0.7 → xhtm-0.8}/xhtml/header/__init__.py +0 -0
  21. {xhtm-0.7 → xhtm-0.8}/xhtml/header/accept.py +0 -0
  22. {xhtm-0.7 → xhtm-0.8}/xhtml/header/content.py +0 -0
  23. {xhtm-0.7 → xhtm-0.8}/xhtml/locale/__init__.py +0 -0
  24. {xhtm-0.7 → xhtm-0.8}/xhtml/locale/template.py +0 -0
  25. {xhtm-0.7 → xhtm-0.8}/xhtml/resource/__init__.py +0 -0
  26. {xhtm-0.7 → xhtm-0.8}/xhtml/resource/favicon.ico +0 -0
  27. {xhtm-0.7 → xhtm-0.8}/xhtml/resource/logo.svg +0 -0
  28. {xhtm-0.7 → xhtm-0.8}/xhtml/template/__init__.py +0 -0
  29. {xhtm-0.7 → xhtm-0.8}/xhtml/template/hello.html +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xhtm
3
- Version: 0.7
3
+ Version: 0.8
4
4
  Summary: Rendering HTML Text
5
5
  Home-page: https://github.com/bondbox/xhtm
6
6
  Author: Mingzhe Zou
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xhtm
3
- Version: 0.7
3
+ Version: 0.8
4
4
  Summary: Rendering HTML Text
5
5
  Home-page: https://github.com/bondbox/xhtm
6
6
  Author: Mingzhe Zou
@@ -1,7 +1,7 @@
1
1
  # coding:utf-8
2
2
 
3
3
  __project__ = "xhtm"
4
- __version__ = "0.7"
4
+ __version__ = "0.8"
5
5
  __urlhome__ = "https://github.com/bondbox/xhtm"
6
6
  __description__ = "Rendering HTML Text"
7
7
 
@@ -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
 
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
File without changes
File without changes