From 31b65e41043900c0cadd80961f4b22cdfc171e7d Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 5 Dec 2018 11:19:07 +0100 Subject: Get GUI to communicate with DPDCE --- python/gui.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'python/gui.py') diff --git a/python/gui.py b/python/gui.py index 512afef..ce7948c 100755 --- a/python/gui.py +++ b/python/gui.py @@ -35,9 +35,9 @@ env = Environment(loader=FileSystemLoader('gui/templates')) base_js = ["js/odr.js"] class Root: - def __init__(self): + def __init__(self, dpd_port): self.mod_rc = zmqrc.ModRemoteControl("localhost") - self.api = API(self.mod_rc) + self.api = API(self.mod_rc, dpd_port) @cherrypy.expose def index(self): @@ -81,6 +81,7 @@ if __name__ == '__main__': allconfig = configparser.ConfigParser() allconfig.read(cli_args.config) config = allconfig['gui'] + dpd_port = allconfig['dpdce'].getint('control_port') daemon = False if daemon: @@ -105,7 +106,7 @@ if __name__ == '__main__': staticdir = os.path.realpath(config['static_directory']) cherrypy.tree.mount( - Root(), config={ + Root(dpd_port), config={ '/': { }, '/dpd': { 'tools.staticdir.on': True, -- cgit v1.2.3