2013-06-04 23:13:18 +02:00
|
|
|
class Service:
|
2013-06-05 04:20:26 +02:00
|
|
|
def __init__(self, host, parser):
|
|
|
|
|
self.host = host
|
2013-06-05 00:09:24 +02:00
|
|
|
self.parser = parser
|
2013-06-05 04:20:26 +02:00
|
|
|
self.errorcode = 0
|
2013-06-05 06:09:55 +02:00
|
|
|
self.errormessage = "No Error!"
|
2013-06-04 23:13:18 +02:00
|
|
|
|
2013-06-04 23:31:24 +02:00
|
|
|
def _execute(self):
|
|
|
|
|
self.pre_execute()
|
2013-06-10 00:31:39 +02:00
|
|
|
executionResult = self.execute()
|
|
|
|
|
parseResult = self.parse_result(executionResult)
|
|
|
|
|
self.handle_result(parseResult)
|
2013-06-05 00:09:24 +02:00
|
|
|
|
2013-06-04 23:13:18 +02:00
|
|
|
def execute(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def pre_execute(self):
|
|
|
|
|
pass
|
|
|
|
|
|
2013-06-10 00:31:39 +02:00
|
|
|
def parse_result(self, executionResult):
|
|
|
|
|
return self.parser._parse(executionResult)
|
2013-06-04 23:13:18 +02:00
|
|
|
|
2013-06-10 00:31:39 +02:00
|
|
|
def handle_result(self, parseResult):
|
|
|
|
|
pass
|