def start_xmlrpc(bindaddr): from xmlrpc.server import (SimpleXMLRPCServer, SimpleXMLRPCRequestHandler) class handler(SimpleXMLRPCRequestHandler): rpc_paths = ('/motionwol',) addr, port = bindaddr.split(':') #long live IPv4 server = SimpleXMLRPCServer((addr, int(port)), allow_none=True, requestHandler=handler) server.register_introspection_functions() server.register_function(disable_rules, 'disable') server.register_function(enable_rules, 'enable') XmlRpcDispatch(server.fileno()).server = server