Skip to content

Commit

Permalink
Merge pull request #126 from ChrisKnott/shw-none-concat
Browse files Browse the repository at this point in the history
 Check if using templating before concat
  • Loading branch information
ChrisKnott authored Mar 5, 2019
2 parents 5e551f3 + 0e1fd6a commit 3bb6f80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change log

### v0.10.3
* Fix a bug that prevented using Eel without Jinja templating.

### v0.10.2
* Only render templates from within the declared jinja template directory.

Expand Down
11 changes: 6 additions & 5 deletions eel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,13 @@ def _eel():

@btl.route('/<path:path>')
def _static(path):
template_prefix = _jinja_templates + '/'
if _jinja_templates is not None:
template_prefix = _jinja_templates + '/'

if _jinja_env != None and path.startswith(template_prefix):
n = len(template_prefix)
template = _jinja_env.get_template(path[n:])
return template.render()
if _jinja_env is not None and path.startswith(template_prefix):
n = len(template_prefix)
template = _jinja_env.get_template(path[n:])
return template.render()

return btl.static_file(path, root=root_path)

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='Eel',
version='0.10.2',
version='0.10.3',
author='Chris Knott',
author_email='[email protected]',
packages=['eel'],
Expand All @@ -13,7 +13,7 @@
install_requires=['bottle', 'bottle-websocket', 'future', 'whichcraft'],
python_requires='>=2.6',
description='For little HTML GUI applications, with easy Python/JS interop',
long_description=open('README.md', encoding='utf-8').readlines()[1],
long_description=open('README.md', encoding='utf-8').read(),
keywords=['gui', 'html', 'javascript', 'electron'],
homepage='https://github.com/ChrisKnott/Eel',
)

0 comments on commit 3bb6f80

Please sign in to comment.