From 486af171bfcf5371a812fc8abc58d62bde8cfd12 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 18 Mar 2008 23:10:17 +0000 Subject: [PATCH] added start_xmlrpc_server() which is used to start a standalone xmlrpc server alternate ports. Useful for running multiple api servers on the same machine --- qaapi/qa/PLCs.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/qaapi/qa/PLCs.py b/qaapi/qa/PLCs.py index e16aaa7..ff0d506 100644 --- a/qaapi/qa/PLCs.py +++ b/qaapi/qa/PLCs.py @@ -27,6 +27,17 @@ class PLC(dict, Remote): self.config = config self.config.update_api(self) + def start_xmlrpc_server(self): + """ + PLCAPI comes with a SimpleServer script that allows you to run a + standalone http server that listens on the specified port. + This is useful for running multiple api servers on the same machine. + """ + if 'host' in self and not host in ['localhost', None]: + server_script = "/usr/share/plc_api/Server.py" + self.commands("%s -p %s" % (server_script, self['port'])) + + class PLCs(list, Table): def __init__(self, config, plcs): -- 2.45.2