Skip to content

Commit

Permalink
Issue NASA-AMMOS#110 - Moved gui port kwarg to plugin init
Browse files Browse the repository at this point in the history
Action requested from the PR review. Moved the port argument to the
plugin class init as a kwarg with a default to port 8080. Kwarg gets
populated based on whats defined in config.yaml.
  • Loading branch information
Robert Schneider committed Aug 13, 2019
1 parent f75693d commit 39d0e4b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ait/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ def __init__(self, inputs, outputs, zmq_args=None, **kwargs):

bottle.TEMPLATE_PATH.append(HTMLRoot.User)

gevent.spawn(self.init)
port = 8080
if 'port' in kwargs:
port = int(kwargs['port'])

gevent.spawn(self.init, port=port)

def process(self, input_data, topic=None):
# msg is going to be a tuple from the ait_packet_handler
Expand Down Expand Up @@ -216,7 +220,7 @@ def process_log_msg(self, msg):
def getBrowserName(self, browser):
return getattr(browser, 'name', getattr(browser, '_name', '(none)'))

def init(self, host=None, port=ait.config.get('gui.port', 8080)):
def init(self, host=None, port=8080):

# The /cmd endpoint requires access to the AITGUIPlugin object so it
# can publish commands via the Plugin interface. It's defined here with
Expand Down

0 comments on commit 39d0e4b

Please sign in to comment.