diff --git a/bin/uplink b/bin/uplink index d08c424..656637b 100755 --- a/bin/uplink +++ b/bin/uplink @@ -172,24 +172,10 @@ def main(): elif args.foreground: from threading import Thread if configuration.get_env_var('_server'): - if configuration.get_httpserver_framework() == 'bottle': - from uplink.server_bottle import Server - s = Server(configuration) - st = Thread(target=s.run_server, daemon=True) - st.start() - elif configuration.get_httpserver_framework() == 'cherrypy': - from uplink.server_cherrypy import Server - s = Server(configuration) - st = Thread(target=s.run_server, daemon=True) - st.start() - elif configuration.get_httpserver_framework() == 'pyramid': - from uplink.server_pyramid import Server - s = Server(configuration) - st = Thread(target=s.run_server, daemon=True) - st.start() - else: - logger.error('[uplink] no http framework configured! ' - '(bottle, cherrypy and pyramid are supported)') + from uplink.server_cherrypy import Server + s = Server(configuration) + st = Thread(target=s.run_server, daemon=True) + st.start() while True: for i in range(len(configuration.get_uplinks())): diff --git a/uplink/uplink.py b/uplink/uplink.py index 18a47d6..37f3191 100644 --- a/uplink/uplink.py +++ b/uplink/uplink.py @@ -95,21 +95,11 @@ class Uplink(Daemon): def run(self): if self.configuration.get_env_var('_server'): - if self.configuration.get_httpserver_framework() == 'bottle': - from uplink.server_bottle import Server - s = Server(self.configuration) - st = Thread(target=s.run_server, daemon=True) - st.start() - elif self.configuration.get_httpserver_framework() == 'cherrypy': - from uplink.server_cherrypy import Server - s = Server(self.configuration) - st = Thread(target=s.run_server, daemon=True) - st.start() - elif self.configuration.get_httpserver_framework() == 'pyramid': - from uplink.server_pyramid import Server - s = Server(self.configuration) - st = Thread(target=s.run_server, daemon=True) - st.start() + from uplink.server_cherrypy import Server + s = Server(self.configuration) + st = Thread(target=s.run_server, daemon=True) + st.start() + while True: for i in range(len(self.configuration.get_uplinks())): ut = Thread(target=self.fetch_data, daemon=True, args=(i,))