Skip to content

Commit

Permalink
Merge pull request #178 from NASA-AMMOS/issue-138
Browse files Browse the repository at this point in the history
Issue #138 - Update GUI static file configuration parameters
  • Loading branch information
MJJoyce authored Nov 16, 2020
2 parents c7bea1d + a6a5ab0 commit 1e96dcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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

0 comments on commit 1e96dcb

Please sign in to comment.