Subversion Repositories SmartDukaan

Rev

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

Rev 3915 Rev 4651
Line 26... Line 26...
26
    
26
    
27
    def __init__(self, options):
27
    def __init__(self, options):
28
        Daemon.__init__(self, options.pidfile, stdout=options.logfile, stderr=options.logfile)
28
        Daemon.__init__(self, options.pidfile, stdout=options.logfile, stderr=options.logfile)
29
        self.host = "localhost"
29
        self.host = "localhost"
30
        self.port = 9999
30
        self.port = 9999
31
        try:
31
        
-
 
32
        if options.environment:
32
            self.environment = os.environ["ENV_TYPE"]
33
            self.enironment = options.environment
33
        except KeyError:
34
        else:
34
            self.environment = "DEV"
35
            self.environment = os.environ['ENV_TYPE']
35
            
36
            
36
        self.cfg_file_name = os.path.dirname(os.path.realpath(__file__)) + '/resources/shop2020.cfg'
37
        self.cfg_file_name = os.path.dirname(os.path.realpath(__file__)) + '/resources/shop2020.cfg'
37
        
38
        
38
        if options.port:
39
        if options.port:
39
            self.port = options.port
40
            self.port = options.port
40
        
41
        
41
        if options.cfg_file_name:
42
        if options.cfg_file_name:
42
            self.cfg_file_name = options.cfg_file_name
43
            self.cfg_file_name = options.cfg_file_name
43
            
44
            
44
        if options.environment:
-
 
45
            self.enironment = options.environment
-
 
46
        
45
        
47
    def run(self):
46
    def run(self):
48
        handler = ConfigServerHandler(self.cfg_file_name, self.environment)
47
        handler = ConfigServerHandler(self.cfg_file_name, self.environment)
49
        processor = Configuration.Processor(handler)
48
        processor = Configuration.Processor(handler)
50
        transport = TSocket.TServerSocket(self.host, self.port)
49
        transport = TSocket.TServerSocket(self.host, self.port)