summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Fink2020-09-25 21:22:53 +0200
committerDennis Fink2020-09-25 21:22:53 +0200
commit1ac22bf82d12fad9b3019d96d27fd3d2b3455289 (patch)
tree96ed38912c75ac39d7d28da4c330c909ff77a6d9
parent89f3121ed601f95f5e32952ff6ade90d565f193f (diff)
downloadpatternutils-1ac22bf82d12fad9b3019d96d27fd3d2b3455289.tar.gz
patternutils-1ac22bf82d12fad9b3019d96d27fd3d2b3455289.zip
Use conditional expression to set fileext in patterncfg add
Diffstat (limited to '')
-rw-r--r--patternutils/commands/patterncfg.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/patternutils/commands/patterncfg.py b/patternutils/commands/patterncfg.py
index 3ef0518..83168cf 100644
--- a/patternutils/commands/patterncfg.py
+++ b/patternutils/commands/patterncfg.py
@@ -61,10 +61,7 @@ def add(template_engine: Optional[str], command: str, name: str) -> None:
if command == "pmatch":
fileext = "regex"
else:
- if template_engine not in ("python", "jinja2"):
- fileext = "python"
- else:
- fileext = template_engine
+ fileext = "jinja2" if template_engine == "jinja2" else "python"
filename = os.path.join(config.CONFIG_PATH, command, f"{name}.{fileext}")
click.edit(filename=filename)