From a4f034b900261972d8a6e465583fc0c6ca452f5e Mon Sep 17 00:00:00 2001 From: Cole Lyman Date: Thu, 31 Oct 2024 10:14:23 -0600 Subject: [PATCH] Update jinja_partials and bring Reports into sync (#111) * Update jinja_partials with improved style * Update pylint.yml file for Github Actions --- .../CRISPRessoReports/.github/workflows/pylint.yml | 5 +++-- CRISPResso2/CRISPRessoReports/jinja_partials.py | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CRISPResso2/CRISPRessoReports/.github/workflows/pylint.yml b/CRISPResso2/CRISPRessoReports/.github/workflows/pylint.yml index 5b7e7e11..7c0d5075 100644 --- a/CRISPResso2/CRISPRessoReports/.github/workflows/pylint.yml +++ b/CRISPResso2/CRISPRessoReports/.github/workflows/pylint.yml @@ -2,8 +2,9 @@ name: Pylint on: push: - branches: - - '*' + + pull_request: + types: [opened, reopened] jobs: build: diff --git a/CRISPResso2/CRISPRessoReports/jinja_partials.py b/CRISPResso2/CRISPRessoReports/jinja_partials.py index 73ec8ce4..74202a30 100644 --- a/CRISPResso2/CRISPRessoReports/jinja_partials.py +++ b/CRISPResso2/CRISPRessoReports/jinja_partials.py @@ -28,6 +28,11 @@ from markupsafe import Markup +try: + import flask +except ImportError: + flask = None + def render_partial(template_name, renderer=None, markup=True, **data): """ @@ -36,8 +41,7 @@ def render_partial(template_name, renderer=None, markup=True, **data): if renderer is None: if flask is None: raise PartialsException('No renderer specified') - else: - renderer = flask.render_template + renderer = flask.render_template if markup: return Markup(renderer(template_name, **data))