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.
- {xhtm-0.5 → xhtm-0.6}/PKG-INFO +2 -2
- {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/PKG-INFO +2 -2
- xhtm-0.6/xhtm.egg-info/requires.txt +2 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/attribute.py +1 -1
- {xhtm-0.5 → xhtm-0.6}/xhtml/header/accept.py +1 -1
- {xhtm-0.5 → xhtm-0.6}/xhtml/header/headers.py +27 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/locale/template.py +1 -1
- xhtm-0.5/xhtm.egg-info/requires.txt +0 -2
- {xhtm-0.5 → xhtm-0.6}/LICENSE +0 -0
- {xhtm-0.5 → xhtm-0.6}/README.md +0 -0
- {xhtm-0.5 → xhtm-0.6}/setup.cfg +0 -0
- {xhtm-0.5 → xhtm-0.6}/setup.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/SOURCES.txt +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/dependency_links.txt +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/top_level.txt +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtm.egg-info/zip-safe +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/__init__.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/element/__init__.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/element/attr.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/element/css.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/element/doc.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/element/tag.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/header/__init__.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/header/content.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/locale/__init__.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/resource/__init__.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/resource/favicon.ico +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/resource/logo.svg +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/template/__init__.py +0 -0
- {xhtm-0.5 → xhtm-0.6}/xhtml/template/hello.html +0 -0
{xhtm-0.5 → xhtm-0.6}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: xhtm
|
|
3
|
-
Version: 0.
|
|
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
|
|
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.
|
|
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
|
|
19
|
+
Requires-Dist: xlc>=1.0
|
|
20
20
|
Requires-Dist: jinja2
|
|
21
21
|
|
|
22
22
|
# xhtm
|
|
@@ -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[
|
|
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
|
|
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:
|
{xhtm-0.5 → xhtm-0.6}/LICENSE
RENAMED
|
File without changes
|
{xhtm-0.5 → xhtm-0.6}/README.md
RENAMED
|
File without changes
|
{xhtm-0.5 → xhtm-0.6}/setup.cfg
RENAMED
|
File without changes
|
{xhtm-0.5 → xhtm-0.6}/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
|