aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/Jinja2/examples/hello
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/python/Jinja2/examples/hello
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/python/Jinja2/examples/hello')
-rw-r--r--contrib/python/Jinja2/examples/hello/__init__.py0
-rw-r--r--contrib/python/Jinja2/examples/hello/__main__.py12
-rw-r--r--contrib/python/Jinja2/examples/hello/templates/hello1
-rw-r--r--contrib/python/Jinja2/examples/hello/ya.make20
4 files changed, 33 insertions, 0 deletions
diff --git a/contrib/python/Jinja2/examples/hello/__init__.py b/contrib/python/Jinja2/examples/hello/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/contrib/python/Jinja2/examples/hello/__init__.py
diff --git a/contrib/python/Jinja2/examples/hello/__main__.py b/contrib/python/Jinja2/examples/hello/__main__.py
new file mode 100644
index 00000000000..51b3d1e3d57
--- /dev/null
+++ b/contrib/python/Jinja2/examples/hello/__main__.py
@@ -0,0 +1,12 @@
+import sys
+
+from jinja2 import Environment, PackageLoader
+
+
+env = Environment(
+ loader=PackageLoader("hello", "templates"),
+)
+
+username = sys.argv[1] if len(sys.argv) > 1 else "Anonymous"
+
+print(env.get_template("hello").render(username=username))
diff --git a/contrib/python/Jinja2/examples/hello/templates/hello b/contrib/python/Jinja2/examples/hello/templates/hello
new file mode 100644
index 00000000000..73e9e1f5b6e
--- /dev/null
+++ b/contrib/python/Jinja2/examples/hello/templates/hello
@@ -0,0 +1 @@
+Hello, {{ username }}!
diff --git a/contrib/python/Jinja2/examples/hello/ya.make b/contrib/python/Jinja2/examples/hello/ya.make
new file mode 100644
index 00000000000..3ad10dba1f7
--- /dev/null
+++ b/contrib/python/Jinja2/examples/hello/ya.make
@@ -0,0 +1,20 @@
+PY3_PROGRAM(jinja2-hello)
+
+OWNER(shadchin)
+
+PEERDIR(
+ contrib/python/Jinja2
+)
+
+PY_SRCS(
+ NAMESPACE hello
+ __init__.py
+ __main__.py
+)
+
+RESOURCE_FILES(
+ PREFIX contrib/python/Jinja2/examples/hello/
+ templates/hello
+)
+
+END()