Skip to content

Commit

Permalink
got rosie to look for disco templates
Browse files Browse the repository at this point in the history
made eslint ignore rosie disco files as it did in master.
  • Loading branch information
wxtim committed Jul 10, 2019
1 parent 6933c34 commit 63273f3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
doc/*
lib/html/static/js/bootstrap*
lib/html/static/js/dataTables.bootstrap*
lib/html/static/js/jquery*
lib/html/static/js/livestamp.min.js
lib/html/static/js/moment.min.js
metomi/rosie/lib/html/static/js/bootstrap*
metomi/rosie/lib/html/static/js/dataTables.bootstrap*
metomi/rosie/lib/html/static/js/jquery*
metomi/rosie/lib/html/static/js/livestamp.min.js
metomi/rosie/lib/html/static/js/moment.min.js
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: "Test Battery"
before_install:
- export PATH="$PWD/.travis:$PATH"
- now install coverage fcm tut_suite
- now install coverage fcm tut_suite requests
install:
- now install isodatetime cylc rose
script:
Expand Down
13 changes: 10 additions & 3 deletions metomi/rosie/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import os
import pwd
import signal
import pkg_resources
from time import sleep
from tornado.ioloop import IOLoop, PeriodicCallback
import tornado.log
Expand Down Expand Up @@ -82,13 +83,19 @@ def __init__(self, service_root_mode=False, *args, **kwargs):
self.props["host_name"] = (
self.props["host_name"].split(".", 1)[0])
self.props["rose_version"] = ResourceLocator.default().get_version()

# Get location of HTML files from package
rosie_lib = os.path.join(
pkg_resources.resource_filename(
'metomi.rosie', 'lib'
), "html", "template", "rosie-disco"
)

# Autoescape markup to prevent code injection from user inputs.
self.props["template_env"] = jinja2.Environment(
autoescape=jinja2.select_autoescape(
enabled_extensions=("html", "xml"), default_for_string=True),
loader=jinja2.FileSystemLoader(
ResourceLocator.default().get_util_home(
"lib", "html", "template", "rosie-disco")))
loader=jinja2.FileSystemLoader(rosie_lib))

db_url_map = {}
for key, node in rose_conf.get(["rosie-db"]).value.items():
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def find_version(*file_paths):
install_requires=INSTALL_REQUIRES,
python_requires=">3.7",
package_data={
"metomi.rose": ["etc/.*", "rose-version"]
"metomi.rose": ["etc/.*", "rose-version"],
"metomi.rosie": ["lib/*"]
},
packages=find_namespace_packages(include=["metomi.*"]),
)

0 comments on commit 63273f3

Please sign in to comment.