"""
@autor:Yue
@date::14:06
@file:settings.py
@project:appQutoInfo

"""

import  os,sys




class baseConfig:

    projectdir=os.path.dirname(os.path.dirname(__file__))
    casedir=os.path.join(projectdir,"testCase")
    staticdir=os.path.join(projectdir,"static","uploadfiles")
    reportsfile=os.path.join(projectdir,"static","reports")
    kdfile=os.path.join(projectdir,"blueprints","KeyData")
    hetong="https://pdf-{namespace}.liangkebang.net"
    newhetong="https://pdf-{namespace}.liangkebang.net/middle_office"
    credit="https://credit-{namespace}.liangkebang.net"
    contract="https://contract-op-{namespace}.liangkebang.net/pdf"
    passportapi='http://passportapi-{namespace}.liangkebang.net'
    api='http://api-{namespace}.liangkebang.net'
    executeJolyne='http://jolyne.liangkebang.com'
    opapi='http://opapi-{namespace}.liangkebang.net'
    clotho="http://clotho-{namespace}.liangkebang.net"
    moclotho="http://mo-clotho-{namespace}.liangkebang.net"
    zijin=moclotho
    mapi="http://mapi-{namespace}.liangkebang.net"
    queryJolyne='http://jolyne.liangkebang.com'
    scapi="http://scapi-{namespace}.liangkebang.net"
    payapi="http://payapi-{namespace}.liangkebang.net"
    pay="http://pay-{namespace}.liangkebang.net"
    Jolyne="http://jolyne.liangkebang.com"
    executeSQL="http://192.168.4.156:9001"
    sc="http://sc-{namespace}.liangkebang.com"
    uoloadcard='http://operator.liangkebang.com'
    msg='http://192.168.4.3:8051'
    zijin="http://mo-clotho-{namespace}.liangkebang.net" #mo-clotho-qa3.liangkebang.net
    fengkong="http://rule-engine.liangkebang.com"
    business="http://business-flow-{namespace}.liangkebang.net"
    assetapi="http://assetapi-{namespace}.liangkebang.net"
    koala="http://koala-{namespace}.liangkebang.net"
    configuration_center="http://mo-config-{namespace}.liangkebang.net"
    account="http://mo-account-{namespace}.liangkebang.net"
    payment=payapi
    trade="http://mo-trade-{namespace}.liangkebang.net"
    transaction=trade
    voice='http://robotweb.q-gp.com'
    Sidecar='http://mo-sidecar-qa3.liangkebang.net'




class testConfig(baseConfig):
    namespace='test1'
    type="mysql"
    host = "172.17.5.13"
    port = 31548
    user = "qa"
    pw = "qatest"
    db = "credit_league"
    charset="utf8"
    #hetong=baseConfig.hetong.format("-"+namespace)
    #credit = baseConfig.credit.format("-"+namespace)

class qaConfig(baseConfig):
    namespace='qa'
    type="mysql"
    host = "172.17.5.13"
    port = 32743
    user = "qa"
    pw = "qatest"
    db = "xyqb"
    charset="utf8"

class preConfig(baseConfig):
    namespace='pre'
    type="mysql"
    host = "172.17.5.14"
    port = 32178
    user = "qa"
    pw = "qatest"
    db = "xyqb"
    charset="utf8"

class qa2Config(baseConfig):
    namespace='qa2'
    type="mysql"
    host = "172.17.5.5"
    port = 31905
    user = "qa"
    pw = "qatest"
    db = "xyqb"
    charset="utf8"

class qa3Config(baseConfig):
    namespace='qa3'
    type="mysql"
    host = "172.17.5.14"
    port = 32659
    user = "qa"
    pw = "qatest"
    db = "xyqb"
    charset="utf8"

class ka2Config(baseConfig):
    namespace='ka2'
    type="mysql"
    host = "172.17.5.8"
    port = 30492
    user = "qa"
    pw = "qatest"
    db = "xyqb"
    charset="utf8"

class test1Config(baseConfig):
    namespace='test1'
    type="mysql"
    host = "172.17.5.14"
    port = 31548
    user = "qa"
    pw = "qatest"
    db = "xyqb_user"
    charset="utf8"


class test11Config(baseConfig):
    namespace='test11'
    type="mysql"
    host = "172.18.3.85"
    port = 3306
    user = "all_test"
    pw = "R1svoGpTfxQn7nCh"
    db = "xyqb"
    charset="utf8"


class msgConfig(baseConfig):
    namespace='msg'
    type="mysql"
    host = "192.168.4.3"
    port = 3306
    user = "qa"
    pw = "qatest"
    db = "xyqb"
    charset="utf8"

config={
    "test":testConfig,
    "ka2":ka2Config,
    "qa":qaConfig,
    "qa2":qa2Config,
    "test1":test1Config,
    "qa3":qa3Config,
    "msg":msgConfig,
    'pre':preConfig,
    'test11':test11Config
}


if __name__ == '__main__':
    #testConfig.env="qa2"
    a=testConfig.hetong
    t='namespace'
    #tt=eval('{0}.{1}'.format(qaConfig,t))
    #tt=qaConfig.namespace
    print(qaConfig.__name__)

    #print(tt)
