Skip to content

Commit

Permalink
refactor: tidy up script load file
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrosquall committed Apr 17, 2022
1 parent e3ecf2f commit 3a04702
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions demo/demo-plugins/footer.py
@@ -1,8 +1,10 @@
from datasette import hookimpl
import os
from os import path

# Store JS in separate file to enable basic IDE hinting support
script_name = path.join(path.dirname(__file__), "footer.js")
SCRIPT = open(script_name).read()

# set variable named script equal to contents of footer.js\
SCRIPT = open(os.path.join(os.path.dirname(__file__), "footer.js")).read()

@hookimpl
def extra_body_script():
Expand Down

0 comments on commit 3a04702

Please sign in to comment.