forked from CZ-NIC/convey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
144 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Subject: Testing e-mail | ||
|
||
Just a bare template. | ||
Keen regards |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
foo,red,second.example.com,foo-2,[email protected],female | ||
foo,red,second.example.com,foo-1,[email protected],male | ||
foo,red,second.example.com,foo-2,[email protected],female | ||
foo,red,second.example.com,foo-1,[email protected],male | ||
foo,green,first.example.com,foo-2,[email protected],female | ||
foo,green,first.example.com,foo-1,[email protected],male | ||
foo,green,first.example.com,foo-2,[email protected],female | ||
foo,green,first.example.com,foo-1,[email protected],male | ||
bar,blue,wikipedia.org,bar-2,[email protected],male | ||
bar,blue,wikipedia.org,bar-1,[email protected],male | ||
bar,yellow,example.com,bar-2,[email protected],male | ||
bar,yellow,example.com,bar-1,[email protected],male | ||
foo,orange,wikipedia.com,foo-2,[email protected],female | ||
foo,orange,wikipedia.com,foo-1,[email protected],male | ||
foo,orange,wikipedia.com,foo-2,[email protected],female | ||
foo,orange,wikipedia.com,foo-1,[email protected],male |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
foo,red,second.example.com,[email protected],female | ||
foo,red,second.example.com,[email protected],male | ||
foo,green,first.example.com,[email protected],female | ||
foo,green,first.example.com,[email protected],male | ||
bar,blue,wikipedia.org,[email protected],male | ||
bar,yellow,example.com,[email protected],male | ||
foo,orange,wikipedia.com,[email protected],female | ||
foo,orange,wikipedia.com,[email protected],male |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
category,price,consumption | ||
bulb,100,30 | ||
bulb,150,10 | ||
kettle,250,70 | ||
kettle,352,80 | ||
bulb,120,15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Subject: My cool dynamic template demonstrating a {% if amount() %}long{% else %}short{% endif %} amount of lines! | ||
|
||
Here we demonstrate jinja templating. | ||
We send you {% if amount() %}lots of colours: {{ joined(1) }}{% else %}single colour: {{ first_row[1] }}{% endif %}. | ||
|
||
{% if amount() %} | ||
Here is the complete list of the multirow file. | ||
{{ attachment() }} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import dateutil | ||
|
||
from convey import PickInput | ||
from convey import PickMethod | ||
|
||
def dumb_method(val): | ||
""" This is a dumb testing method """ | ||
return f"-{val}-" | ||
|
||
def list_method(arg): | ||
""" This external type returns a list. The lines should be duplicated. """ | ||
return [arg + "-1", arg + "-2"] | ||
|
||
|
||
@PickInput | ||
def time_format(val, format_="%H:%M"): | ||
""" This text will be displayed to the user. | ||
If running in headless mode, the default format will be "%H:%M" (hours:minutes). """ | ||
return dateutil.parser.parse(val).strftime(format_) | ||
|
||
|
||
@PickMethod("all") | ||
class PickMethodTest(PickMethod): | ||
@staticmethod | ||
def all(x): | ||
""" All of them. """ | ||
return x | ||
|
||
@classmethod | ||
def filtered(cls, x): | ||
""" Filter some of them """ | ||
if x in ["a", "b", "c"]: | ||
return x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[email protected],black.gif | ||
[email protected],white.gif | ||
[email protected],white.gif | ||
[email protected],black.gif | ||
[email protected],red-permission.gif | ||
[email protected],black.gif | ||
[email protected],white.gif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[email protected],foo,male | ||
[email protected],foo,female | ||
[email protected],bar,male | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[email protected],foo,male,black.gif | ||
[email protected],foo,female,white.gif | ||
[email protected],bar,male,black.gif | ||
[email protected],bar,male,red-permission.gif | ||
[email protected],bar,male,white.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
e-mail,random column,gender | ||
[email protected],foo,male | ||
[email protected],foo,female |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
foo,red,second.example.com | ||
foo,green,first.example.com | ||
bar,blue,wikipedia.org | ||
bar,yellow,example.com | ||
foo,orange,wikipedia.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
foo,red,second.example.com,foo-2 | ||
foo,red,second.example.com,foo-1 | ||
foo,green,first.example.com,foo-2 | ||
foo,green,first.example.com,foo-1 | ||
bar,blue,wikipedia.org,bar-2 | ||
bar,blue,wikipedia.org,bar-1 | ||
bar,yellow,example.com,bar-2 | ||
bar,yellow,example.com,bar-1 | ||
foo,orange,wikipedia.com,foo-2 | ||
foo,orange,wikipedia.com,foo-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
word;colour;host;colour2 | ||
foo;red;second.example.com;blue | ||
foo;green;first.example.com;blue | ||
bar;blue;wikipedia.org;yellow | ||
bar;yellow;example.com; | ||
foo;orange;wikipedia.com; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
word,colour,host,colour2,word,colour,host | ||
foo,red,second.example.com,blue,,, | ||
foo,green,first.example.com,blue,,, | ||
bar,blue,wikipedia.org,yellow,foo,green,first.example.com | ||
bar,blue,wikipedia.org,yellow,foo,red,second.example.com | ||
bar,yellow,example.com,,bar,blue,wikipedia.org | ||
foo,orange,wikipedia.com,,,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
word,colour,host,colour2,[email protected],male | ||
foo,red,second.example.com,blue,[email protected],female | ||
foo,red,second.example.com,blue,[email protected],male | ||
foo,green,first.example.com,blue,[email protected],female | ||
foo,green,first.example.com,blue,[email protected],male | ||
bar,blue,wikipedia.org,yellow,[email protected],male | ||
bar,yellow,example.com,,[email protected],male | ||
foo,orange,wikipedia.com,,[email protected],female | ||
foo,orange,wikipedia.com,,[email protected],male |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
foo,red,second.example.com,[email protected],female | ||
foo,red,second.example.com,[email protected],male | ||
foo,green,first.example.com,[email protected],female | ||
foo,green,first.example.com,[email protected],male | ||
bar,blue,wikipedia.org,, | ||
bar,yellow,example.com,, | ||
foo,orange,wikipedia.com,[email protected],female | ||
foo,orange,wikipedia.com,[email protected],male |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.