def parse_webservice(webservice): """ :param webservice: :return: """ assert type(webservice) == dict assert 'type' in webservice return WebService.parse(webservice)
def parse(data): # obj = WebServiceJson() # WebServiceJson.__init__(WebService.parse(data)) obj = WebService.parse(data) obj.value = data.get('value', None) return obj
def marshal(self): obj = WebService.marshal(self) obj.update({'value': self.value})
def __init__(self, *args, **kwargs): WebService.__init__(self, *args, **kwargs) self.service_type = 'json' self.value = 23
def parse(data): obj = WebService.parse(data) return obj
def __init__(self, *args, **kwargs): WebService.__init__(self, *args, **kwargs) self.service_type = 'nodeinfo'
def parse(data): # obj = WebServiceStatic.__init__(WebService.parse(data)) # obj.directory = data.get('directory', None) obj = WebService.parse(data) obj.directory = data.get('directory', None) return obj
def marshal(self): obj = WebService.marshal(self) obj.update({'directory': self.directory})
def __init__(self, *args, **kwargs): WebService.__init__(self, *args, **kwargs) self.service_type = 'static' self.directory = '.'