summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Fink2019-10-11 23:15:27 +0200
committerDennis Fink2019-10-11 23:15:27 +0200
commitbbeae191e70e1e703e7b5d87a4255803f50f10d0 (patch)
treeded9df5923b2180d965d900e689a2b1b8ea27e6c
parent26a8ef1e0ebc0a9d462c393827473ce9d4516e31 (diff)
downloadpatternutils-bbeae191e70e1e703e7b5d87a4255803f50f10d0.tar.gz
patternutils-bbeae191e70e1e703e7b5d87a4255803f50f10d0.zip
Simplify template engine detection in config.load_template
Diffstat (limited to '')
-rw-r--r--patternutils/config.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/patternutils/config.py b/patternutils/config.py
index c83d68c..5ea7edf 100644
--- a/patternutils/config.py
+++ b/patternutils/config.py
@@ -22,13 +22,7 @@ def load_template(template_name: str, command_name: Optional[str]) -> Tuple[str,
raise RuntimeError('Multiple files found!')
output_pattern = template_lines.replace('\n', '')
-
- for fileext in ('regex', 'jinja2'):
- if template_file.endswith(fileext):
- template_engine = fileext
- break
- else:
- template_engine = 'python'
+ template_engine = os.path.splitext(template_file)[1]
return output_pattern, template_engine