Skip to content

Commit 8e5d6a5

Browse files
committed
py: Package stdlib module and integrate templatelib.
Signed-off-by: Koudai Aono <[email protected]>
1 parent 34c4ee1 commit 8e5d6a5

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

python-stdlib/string/manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
metadata(version="0.1.1")
22

3-
module("string.py")
3+
package("string", ("__init__.py",))

python-stdlib/string/string.py renamed to python-stdlib/string/string/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,19 @@
99
punctuation = """!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
1010
printable = digits + ascii_letters + punctuation + whitespace
1111

12+
__all__ = [
13+
"whitespace",
14+
"ascii_lowercase",
15+
"ascii_uppercase",
16+
"ascii_letters",
17+
"digits",
18+
"hexdigits",
19+
"octdigits",
20+
"punctuation",
21+
"printable",
22+
"translate",
23+
]
24+
1225

1326
def translate(s, map):
1427
import io
@@ -25,3 +38,11 @@ def translate(s, map):
2538
else:
2639
sb.write(c)
2740
return sb.getvalue()
41+
42+
try:
43+
from . import templatelib as _templatelib
44+
except ImportError:
45+
pass
46+
else:
47+
templatelib = _templatelib
48+
__all__.append("templatelib")

0 commit comments

Comments
 (0)