Subversion Repositories SmartDukaan

Rev

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

Rev 3130 Rev 3160
Line 10... Line 10...
10
from shop2020.config.impl.ConfigServerHandler import ConfigServerHandler
10
from shop2020.config.impl.ConfigServerHandler import ConfigServerHandler
11
from thrift.protocol.TBinaryProtocol import TBinaryProtocolFactory
11
from thrift.protocol.TBinaryProtocol import TBinaryProtocolFactory
12
from shop2020.thriftpy.config import Configuration
12
from shop2020.thriftpy.config import Configuration
13
from thrift.transport import TSocket, TTransport
13
from thrift.transport import TSocket, TTransport
14
from thrift.server import TServer
14
from thrift.server import TServer
15
 
-
 
16
def main(argv):
15
def main(argv):
17
        
16
        
18
    try:
17
    try:
19
        opts, args = getopt(argv,"p:f:e", ["port=", "file=", "env="])
18
        opts, args = getopt(argv,"p:f:e", ["port=", "file=", "env="])
20
    except GetoptError:
19
    except GetoptError:
Line 23... Line 22...
23
 
22
 
24
    try:
23
    try:
25
        environment = os.environ["ENV_TYPE"]
24
        environment = os.environ["ENV_TYPE"]
26
    except KeyError:
25
    except KeyError:
27
        environment = "DEV"
26
        environment = "DEV"
28
        
27
    
29
    cfg_file_name = '/tmp/shop2020.cfg'
28
    cfg_file_name = os.getcwd() + '/resources/shop2020.cfg'
-
 
29
    
30
    port = 9999
30
    port = 9999
31
    for opt,arg in opts:
31
    for opt,arg in opts:
32
        if opt in ('-p', "--port"):
32
        if opt in ('-p', "--port"):
33
            port = arg;
33
            port = arg;
34
        elif opt in ('-f', "--file"):
34
        elif opt in ('-f', "--file"):