From 6b0970c6c6efbf983acc68bab280e59547e5d939 Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 10 Mar 2020 15:10:22 -0400 Subject: [PATCH 1/5] added ability to provide a path to a template file --- pystache/renderer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pystache/renderer.py b/pystache/renderer.py index ff6a90c6..c4c62501 100644 --- a/pystache/renderer.py +++ b/pystache/renderer.py @@ -6,6 +6,7 @@ """ import sys +import os from pystache import defaults from pystache.common import TemplateNotFoundError, MissingTags, is_string @@ -450,6 +451,8 @@ def render(self, template, *context, **kwargs): all items in the *context list. """ + if is_string(template) and os.path.isfile(template) and os.access(template, os.R_OK): + return self.render_path(self, template, *context, **kwargs) if is_string(template): return self._render_string(template, *context, **kwargs) if isinstance(template, ParsedTemplate): From d6bf5b03d87293c223f9fdda2648764dd36f67b4 Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 10 Mar 2020 18:38:50 -0400 Subject: [PATCH 2/5] Create pylint.yml add pylint action --- .github/workflows/pylint.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 00000000..701f82fb --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,18 @@ +name: pylint + +on: + push: + paths: + - "**.py" + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: GitHub Action for pylint + uses: cclauss/GitHub-Action-for-pylint@0.7.0 + with: + args: "pylint **.py" From 08d7d576eec005ddc69da0cdd938078ae4a770b2 Mon Sep 17 00:00:00 2001 From: jgstew Date: Tue, 10 Mar 2020 18:39:58 -0400 Subject: [PATCH 3/5] Update renderer.py --- pystache/renderer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pystache/renderer.py b/pystache/renderer.py index c4c62501..19519d59 100644 --- a/pystache/renderer.py +++ b/pystache/renderer.py @@ -452,6 +452,7 @@ def render(self, template, *context, **kwargs): """ if is_string(template) and os.path.isfile(template) and os.access(template, os.R_OK): + # should self be the first arg in the function call? return self.render_path(self, template, *context, **kwargs) if is_string(template): return self._render_string(template, *context, **kwargs) From 59b1f15d6ce56bbfedbb29249b2959d94fa1861e Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 11 Mar 2020 14:12:41 -0400 Subject: [PATCH 4/5] Revert "Update renderer.py" This reverts commit 08d7d576eec005ddc69da0cdd938078ae4a770b2. --- pystache/renderer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pystache/renderer.py b/pystache/renderer.py index 19519d59..c4c62501 100644 --- a/pystache/renderer.py +++ b/pystache/renderer.py @@ -452,7 +452,6 @@ def render(self, template, *context, **kwargs): """ if is_string(template) and os.path.isfile(template) and os.access(template, os.R_OK): - # should self be the first arg in the function call? return self.render_path(self, template, *context, **kwargs) if is_string(template): return self._render_string(template, *context, **kwargs) From 87ba84be56eb641475b09c6e669d8546857bfe73 Mon Sep 17 00:00:00 2001 From: jgstew Date: Wed, 11 Mar 2020 14:13:05 -0400 Subject: [PATCH 5/5] Revert "Create pylint.yml" This reverts commit d6bf5b03d87293c223f9fdda2648764dd36f67b4. --- .github/workflows/pylint.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml deleted file mode 100644 index 701f82fb..00000000 --- a/.github/workflows/pylint.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: pylint - -on: - push: - paths: - - "**.py" - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: GitHub Action for pylint - uses: cclauss/GitHub-Action-for-pylint@0.7.0 - with: - args: "pylint **.py"