From: Jon <31494475+jonioni@users.noreply.github.com> Date: Fri, 21 Sep 2018 05:04:48 +0000 (-0400) Subject: Supporting Partial File Without File Extension X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=c4645f24b0929b2f83d836b0679896cf840d7ac2;p=chevron.git Supporting Partial File Without File Extension Change made to function `_get_partial_ext`: From `path = partials_path + '/' + name + '.' + partials_ext` to `path = partials_path + '/' + name + ('.' + partials_ext if partials_ext else '')`. --- diff --git a/chevron/renderer.py b/chevron/renderer.py index 3c284d1..c6b19e9 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -90,7 +90,7 @@ def _get_partial(name, partials_dict, partials_path, partials_ext): # Nope... try: # Maybe it's in the file system - path = partials_path + '/' + name + '.' + partials_ext + path = partials_path + '/' + name + ('.' + partials_ext if partials_ext else '') with open(path, 'r') as partial: return partial.read()