Subversion Repositories SmartDukaan

Rev

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

Rev 3006 Rev 3007
Line 10... Line 10...
10
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
10
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
11
from shop2020.thriftpy.utils import HelperService
11
from shop2020.thriftpy.utils import HelperService
12
 
12
 
13
class HelperClient:
13
class HelperClient:
14
    
14
    
15
    host = "localhost"
-
 
16
    port = "9008"
15
    
17
    
16
    
18
    def __init__(self):
17
    def __init__(self):
19
        try:
18
        try:
20
            self.config_client = ConfigClient()
19
            self.config_client = ConfigClient()
21
            self.host = self.config_client.get_property("helper_service_server_host")
20
            self.host = self.config_client.get_property("helper_service_server_host")
22
            self.port = self.config_client.get_property("helper_service_server_port")
21
            self.port = self.config_client.get_property("helper_service_server_port")
23
        except:
22
        except:
-
 
23
            self.host = "localhost"
-
 
24
            self.port = "9008"
24
            log_entry(self, "error getting data from config")
25
            log_entry(self, "error getting data from config")
25
        self.__start__()
26
        self.__start__()
26
        
27
        
27
    def __start__(self):
28
    def __start__(self):
28
        self.transport = TSocket(self.host, self.port)
29
        self.transport = TSocket(self.host, self.port)