diff --git a/frappy/server.py b/frappy/server.py index d524ab6..89cf568 100644 --- a/frappy/server.py +++ b/frappy/server.py @@ -71,19 +71,18 @@ class Server: multiple cfg files, the interface is taken from the first cfg file - testonly: test mode. tries to build all modules, but the server is not started - Format of cfg file (for now, both forms are accepted): - old form: new form: - - [node ] [NODE] - description= id= - description= - - [interface tcp] [INTERFACE] - bindport=10769 uri=tcp://10769 - bindto=0.0.0.0 - - [module temp] [temp] - ramp=12 ramp=12 + Config file: + Format: Example: + Node('', Node('ex.frappy.demo', + , 'short description\n\nlong descr.', +
, 'tcp://10769', + secondary=[ secondary=['ws://10770'], # optional + + ], + ) ) + Mod('', Mod('temp', + value = Param(unit='K'), + ) ) ... """ self._testonly = testonly @@ -156,7 +155,10 @@ class Server: iface_threads = [] interfaces_started = MultiEvent(default_timeout=1)#default_timeout=15) lock = threading.Lock() - for interface in [self.node_cfg['interface']] + self.node_cfg.get('interfaces', []): + # TODO: check if only one interface of each type is open? + for interface in [self.node_cfg['interface']] + self.node_cfg.get( + 'secondary', [] + ): opts = {'uri': interface} t = mkthread( self._interfaceThread,