Code: Alles auswählen
def start_server(self):
# Create server.
self.server = SimpleXMLRPCServer.SimpleXMLRPCServer((self.host, self.port))
# Register all methods starting with "rp_".
for attr in dir(self):
if attr.startswith("rp_"):
func = getattr(self, attr)
if type(func) == types.FunctionType:
self.server.register_function(func)
print type(func), types.FunctionType, types.InstanceType
# Start server.
#self.server.serve_forever()
Code: Alles auswählen
<type 'instancemethod'> <type 'function'> <type 'instance'>