xhtm 0.5__tar.gz → 0.6__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 (30) hide show
  1. {xhtm-0.5 → xhtm-0.6}/PKG-INFO +2 -2
  2. {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/PKG-INFO +2 -2
  3. xhtm-0.6/xhtm.egg-info/requires.txt +2 -0
  4. {xhtm-0.5 → xhtm-0.6}/xhtml/attribute.py +1 -1
  5. {xhtm-0.5 → xhtm-0.6}/xhtml/header/accept.py +1 -1
  6. {xhtm-0.5 → xhtm-0.6}/xhtml/header/headers.py +27 -0
  7. {xhtm-0.5 → xhtm-0.6}/xhtml/locale/template.py +1 -1
  8. xhtm-0.5/xhtm.egg-info/requires.txt +0 -2
  9. {xhtm-0.5 → xhtm-0.6}/LICENSE +0 -0
  10. {xhtm-0.5 → xhtm-0.6}/README.md +0 -0
  11. {xhtm-0.5 → xhtm-0.6}/setup.cfg +0 -0
  12. {xhtm-0.5 → xhtm-0.6}/setup.py +0 -0
  13. {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/SOURCES.txt +0 -0
  14. {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/dependency_links.txt +0 -0
  15. {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/top_level.txt +0 -0
  16. {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/zip-safe +0 -0
  17. {xhtm-0.5 → xhtm-0.6}/xhtml/__init__.py +0 -0
  18. {xhtm-0.5 → xhtm-0.6}/xhtml/element/__init__.py +0 -0
  19. {xhtm-0.5 → xhtm-0.6}/xhtml/element/attr.py +0 -0
  20. {xhtm-0.5 → xhtm-0.6}/xhtml/element/css.py +0 -0
  21. {xhtm-0.5 → xhtm-0.6}/xhtml/element/doc.py +0 -0
  22. {xhtm-0.5 → xhtm-0.6}/xhtml/element/tag.py +0 -0
  23. {xhtm-0.5 → xhtm-0.6}/xhtml/header/__init__.py +0 -0
  24. {xhtm-0.5 → xhtm-0.6}/xhtml/header/content.py +0 -0
  25. {xhtm-0.5 → xhtm-0.6}/xhtml/locale/__init__.py +0 -0
  26. {xhtm-0.5 → xhtm-0.6}/xhtml/resource/__init__.py +0 -0
  27. {xhtm-0.5 → xhtm-0.6}/xhtml/resource/favicon.ico +0 -0
  28. {xhtm-0.5 → xhtm-0.6}/xhtml/resource/logo.svg +0 -0
  29. {xhtm-0.5 → xhtm-0.6}/xhtml/template/__init__.py +0 -0
  30. {xhtm-0.5 → xhtm-0.6}/xhtml/template/hello.html +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xhtm
3
- Version: 0.5
3
+ Version: 0.6
4
4
  Summary: Rendering HTML Text
5
5
  Home-page: https://github.com/bondbox/xhtm
6
6
  Author: Mingzhe Zou
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3
16
16
  Requires-Python: >=3.8
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: xlc>=0.6
19
+ Requires-Dist: xlc>=1.0
20
20
  Requires-Dist: jinja2
21
21
 
22
22
  # xhtm
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xhtm
3
- Version: 0.5
3
+ Version: 0.6
4
4
  Summary: Rendering HTML Text
5
5
  Home-page: https://github.com/bondbox/xhtm
6
6
  Author: Mingzhe Zou
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3
16
16
  Requires-Python: >=3.8
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: xlc>=0.6
19
+ Requires-Dist: xlc>=1.0
20
20
  Requires-Dist: jinja2
21
21
 
22
22
  # xhtm
@@ -0,0 +1,2 @@
1
+ xlc>=1.0
2
+ jinja2
@@ -1,7 +1,7 @@
1
1
  # coding:utf-8
2
2
 
3
3
  __project__ = "xhtm"
4
- __version__ = "0.5"
4
+ __version__ = "0.6"
5
5
  __urlhome__ = "https://github.com/bondbox/xhtm"
6
6
  __description__ = "Rendering HTML Text"
7
7
 
@@ -41,7 +41,7 @@ class AcceptLanguage():
41
41
  def __contains__(self, langtag: LangT) -> bool:
42
42
  return LangTag.get_name(langtag) in self.__languages
43
43
 
44
- def __iter__(self) -> Iterator[LangTag]:
44
+ def __iter__(self) -> Iterator[str]:
45
45
  return iter(self.__languages)
46
46
 
47
47
  def __len__(self) -> int:
@@ -1,6 +1,8 @@
1
1
  # coding:utf-8
2
2
 
3
3
  from enum import Enum
4
+ from typing import Dict
5
+ from typing import Iterator
4
6
 
5
7
 
6
8
  class Headers(Enum):
@@ -65,3 +67,28 @@ class Headers(Enum):
65
67
  VARY = "Vary"
66
68
  VIA = "Via"
67
69
  WARNING = "Warning"
70
+
71
+
72
+ class Cookies():
73
+ def __init__(self, *cookies: str):
74
+ self.__cookies: Dict[str, str] = {}
75
+ for items in cookies:
76
+ for item in items.split(";"):
77
+ if cookie := item.strip():
78
+ k, v = cookie.split("=", maxsplit=1)
79
+ self.__cookies[k.strip()] = v.strip()
80
+
81
+ def __len__(self) -> int:
82
+ return len(self.__cookies)
83
+
84
+ def __iter__(self) -> Iterator[str]:
85
+ return iter(self.__cookies)
86
+
87
+ def __getitem__(self, key: str) -> str:
88
+ return self.__cookies[key]
89
+
90
+ def __contains__(self, key: str) -> bool:
91
+ return key in self.__cookies
92
+
93
+ def get(self, key: str, default: str = "") -> str:
94
+ return self.__cookies.get(key, default)
@@ -11,7 +11,7 @@ from xhtml.template import Template
11
11
 
12
12
  class LocaleTemplate(Template):
13
13
  def __init__(self, base: str):
14
- self.__message: Message = Message.load(join(base, "locale"))
14
+ self.__message: Message = Message(join(base, "locale"))
15
15
  super().__init__(base)
16
16
 
17
17
  def search(self, accept_language: str, section: str) -> Section:
@@ -1,2 +0,0 @@
1
- xlc>=0.6
2
- jinja2
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