Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #138 - Update GUI static file configuration parameters #178

Merged
merged 7 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions ait/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ def reset(self):
_RUNNING_SEQ = None
CMD_API = ait.core.api.CmdAPI()


class HTMLRoot:
Static = pkg_resources.resource_filename('ait.gui', 'static/')
User = ait.config.get('gui.html.directory', Static)
Static = User = pkg_resources.resource_filename('ait.gui', 'static/')

SEQRoot = ait.config.get('sequence.directory', None)
if SEQRoot and not os.path.isdir(SEQRoot):
Expand Down Expand Up @@ -280,8 +280,10 @@ def __init__(self, inputs, outputs, zmq_args=None, **kwargs):

try:
HTMLRoot.User = kwargs['html']['directory']
log.info('[GUI Plugin Configuration] Static file directory is set to {}'.format(HTMLRoot.User))
except:
pass
log.warn('[GUI Plugin Configuration] Unable to locate static file direcotry in config.yaml. '\
'The directory is set to {}'.format(HTMLRoot.User))

bottle.TEMPLATE_PATH.append(HTMLRoot.User)

Expand Down
2 changes: 2 additions & 0 deletions doc/source/new_project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ You'll need to update your **server** configuration to enable the GUI Plugin. Ad
- telem_stream
outputs:
- command_stream
html:
directory: /path/to/ait-gui/static/dir

The definitions for **log_stream**, **telem_stream**, and **command_stream** exist in the example Core **config.yaml** file.

Expand Down