Subversion Repositories SmartDukaan

Rev

Rev 412 | Rev 748 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 412 Rev 574
Line 18... Line 18...
18
    def __init__(self):
18
    def __init__(self):
19
        try:
19
        try:
20
            self.config_client = ConfigClient()
20
            self.config_client = ConfigClient()
21
            self.host = self.config_client.get_property("logistics_service_hostname")
21
            self.host = self.config_client.get_property("logistics_service_hostname")
22
            self.port = self.config_client.get_property("logistics_service_port")
22
            self.port = self.config_client.get_property("logistics_service_port")
23
            
-
 
24
        except:
23
        except:
-
 
24
            self.host="localhost"
-
 
25
            self.port="9010"
25
            log_entry("error getting data from config")
26
            log_entry("error getting data from config")
-
 
27
        self.__start__()
26
        
28
        
27
    def __start__(self):
29
    def __start__(self):
28
        self.transport = TSocket.TSocket(self.host, self.port)
30
        self.transport = TSocket.TSocket(self.host, self.port)
29
        self.transport = TFramedTransport(self.transport)
31
        self.transport = TFramedTransport(self.transport)
30
        self.protocol = TBinaryProtocol(self.transport)    
32
        self.protocol = TBinaryProtocol(self.transport)
31
        self.client = LogisticsService.Client(self.protocol)
33
        self.client = LogisticsService.Client(self.protocol)
32
        self.transport.open()
34
        self.transport.open()
33
        
35
        
34
    def get_client(self):
36
    def get_client(self):
35
        return self.client
37
        return self.client