Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.template
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.recipe.template
Commits
36d4fba9
Commit
36d4fba9
authored
Feb 01, 2022
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jinja2: use new output/inline/url options in tests
parent
7fa2695a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
slapos/recipe/template/README.jinja2.txt
slapos/recipe/template/README.jinja2.txt
+24
-24
No files found.
slapos/recipe/template/README.jinja2.txt
View file @
36d4fba9
...
...
@@ -25,8 +25,8 @@ Example demonstrating some types::
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template
= foo.in
...
rendered
= foo
...
url
= foo.in
...
output
= foo
... context =
... key bar section:key
... key recipe :recipe
...
...
@@ -100,8 +100,8 @@ rendering::
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template = inline:
dummy
...
rendered
= foo_once
...
inline =
dummy
...
output
= foo_once
... once = foo_flag
... ''')
>>> run_buildout()
...
...
@@ -158,9 +158,9 @@ It's also possible to use the same file for ``rendered`` and ``once``::
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template = inline:
initial content
...
rendered
= rendered
... once = ${:
rendered
}
...
inline =
initial content
...
output
= rendered
... once = ${:
output
}
... ''')
>>> run_buildout() # doctest: +ELLIPSIS
Uninstalling template.
...
...
@@ -175,7 +175,7 @@ Template was rendered::
When buildout options are modified, the template will not be rendered again::
>>> with open('buildout.cfg', 'a') as f:
... f.writelines(['
template = inline:
something different'])
... f.writelines(['
inline =
something different'])
>>> run_buildout()
Uninstalling template.
...
...
@@ -223,8 +223,8 @@ will be installed as dependency::
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template = inline:
{{bar}}
...
rendered
= foo
...
inline =
{{bar}}
...
output
= foo
... context = key bar dependency:foobar
...
... [dependency]
...
...
@@ -277,9 +277,9 @@ Let's just use ``buildout.cfg`` using this egg::
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template = inline:
...
inline =
... {{bar}}
...
rendered
= foo
...
output
= foo
... context = key bar sample:data
...
... [sample]
...
...
@@ -314,8 +314,8 @@ whitespace-separated. By default, none is loaded.
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template
= foo.in
...
rendered
= foo
...
url
= foo.in
...
output
= foo
... context = key bar buildout:parts
... # We don't actually use all those extensions in this minimal example.
... extensions = jinja2.ext.do jinja2.ext.loopcontrols
...
...
@@ -369,8 +369,8 @@ imported::
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template
= template.in
...
rendered
= bar
...
url
= template.in
...
output
= bar
... import-list = rawfile library library.in
... ''')
>>> run_buildout()
...
...
@@ -390,8 +390,8 @@ Just like context definition, it also works with indirect values::
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template
= template.in
...
rendered
= bar
...
url
= template.in
...
output
= bar
... import-list = file library template-library:path
... ''')
>>> run_buildout()
...
...
@@ -432,8 +432,8 @@ All templates can be accessed inside both folders::
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template
= template.in
...
rendered
= bar
...
url
= template.in
...
output
= bar
... import-list =
... rawfolder dir_a a
... rawfolder dir_b b
...
...
@@ -469,8 +469,8 @@ path)::
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template
= template.in
...
rendered
= bar
...
url
= template.in
...
output
= bar
... import-delimiter = \
... import-list =
... rawfolder dir_a a
...
...
@@ -517,8 +517,8 @@ Errors in template
...
... [template]
... recipe = slapos.recipe.template:jinja2
...
template
= template.in
...
rendered
= foo
...
url
= template.in
...
output
= foo
... ''')
>>> 0; run_buildout() # doctest: +ELLIPSIS
0...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment