diff options
author | Yoann QUERET <yoann@queret.net> | 2015-10-02 16:48:59 +0200 |
---|---|---|
committer | Yoann QUERET <yoann@queret.net> | 2015-10-02 16:48:59 +0200 |
commit | 99e95b71ad1f389ff041ede3eae3009c9993a419 (patch) | |
tree | 9c9593c12e5ea08eb7de21697e9df35b89bb0fb3 /gui | |
parent | 845af2d9c4abb7669594444d293b3c7072b1e161 (diff) | |
download | dabmux-99e95b71ad1f389ff041ede3eae3009c9993a419.tar.gz dabmux-99e95b71ad1f389ff041ede3eae3009c9993a419.tar.bz2 dabmux-99e95b71ad1f389ff041ede3eae3009c9993a419.zip |
Use space indentation insted tab
Diffstat (limited to 'gui')
-rw-r--r-- | gui/muxconfig.py | 32 | ||||
-rwxr-xr-x | gui/odr-dabmux-gui.py | 22 |
2 files changed, 27 insertions, 27 deletions
diff --git a/gui/muxconfig.py b/gui/muxconfig.py index 62f182f..3888a6c 100644 --- a/gui/muxconfig.py +++ b/gui/muxconfig.py @@ -28,7 +28,7 @@ class General(object): def __init__(self, pt): ptree = pt['general'] for fieldname in [ - "nbframes", + "nbframes", "statsserverport", "writescca", "tist", @@ -46,7 +46,7 @@ class Service(object): self.name = name for fieldname in [ - "id", + "id", "label", "shortlabel", "pty", @@ -61,7 +61,7 @@ class Subchannel(object): def __init__(self, name, ptree): self.name = name for fieldname in [ - "type", + "type", "inputfile", "zmq-buffer", "zmq-prebuffering", @@ -106,22 +106,22 @@ class ConfigurationHandler(object): #self.sock.connect("tcp://{}:{}".format(self._host, self._port)) def zRead(self, key): - self._ctx = zmq.Context() + self._ctx = zmq.Context() self.sock = zmq.Socket(self._ctx, zmq.REQ) self.sock.setsockopt(zmq.LINGER, 0) self.sock.connect("tcp://{}:{}".format(self._host, self._port)) - self.sock.send(key) - - # use poll for timeouts: - poller = zmq.Poller() - poller.register(self.sock, zmq.POLLIN) - if poller.poll(5*1000): # 5s timeout in milliseconds - recv = self.sock.recv() - self.sock.close() - self._ctx.term() - return recv - else: - raise IOError("Timeout processing ZMQ request") + self.sock.send(key) + + # use poll for timeouts: + poller = zmq.Poller() + poller.register(self.sock, zmq.POLLIN) + if poller.poll(5*1000): # 5s timeout in milliseconds + recv = self.sock.recv() + self.sock.close() + self._ctx.term() + return recv + else: + raise IOError("Timeout processing ZMQ request") def load(self): """Load the configuration from the multiplexer and save it locally""" diff --git a/gui/odr-dabmux-gui.py b/gui/odr-dabmux-gui.py index 5a3de76..85098f8 100755 --- a/gui/odr-dabmux-gui.py +++ b/gui/odr-dabmux-gui.py @@ -114,15 +114,15 @@ def send_static(filename): if __name__ == '__main__': - # Get configuration file in argument - parser = argparse.ArgumentParser(description='management server for ODR-DabMux') - parser.add_argument('--host', default='127.0.0.1', help='socket host (default: 127.0.0.1)',required=False) - parser.add_argument('--port', default='8000', help='socket port (default: 8000)',required=False) - parser.add_argument('--mhost', default='127.0.0.1', help='mux host (default: 127.0.0.1)',required=False) - parser.add_argument('--mport', default='12720', help='mux port (default: 12720)',required=False) - cli_args = parser.parse_args() - - conf = ConfigurationHandler(cli_args.mhost, cli_args.mport) - - run(host=cli_args.host, port=int(cli_args.port), debug=True, reloader=False) + # Get configuration file in argument + parser = argparse.ArgumentParser(description='management server for ODR-DabMux') + parser.add_argument('--host', default='127.0.0.1', help='socket host (default: 127.0.0.1)',required=False) + parser.add_argument('--port', default='8000', help='socket port (default: 8000)',required=False) + parser.add_argument('--mhost', default='127.0.0.1', help='mux host (default: 127.0.0.1)',required=False) + parser.add_argument('--mport', default='12720', help='mux port (default: 12720)',required=False) + cli_args = parser.parse_args() + + conf = ConfigurationHandler(cli_args.mhost, cli_args.mport) + + run(host=cli_args.host, port=int(cli_args.port), debug=True, reloader=False) |