# encoding=utf-8
import configparser
import os
import inspect
import sys
import pymysql
sys.path.append(os.path.abspath(os.getcwd() + '/database'))


# from https://wiki.python.org/moin/ConfigParserExamples
def ConfigSectionMap(section, config):
    dict1 = {}
    options = config.options(section)
    for option in options:
        try:
            dict1[option] = config.get(section, option)
            if dict1[option] == -1:
                print("skip: %s" % option)
        except Exception:
            print("exception on %s!" % option)
            dict1[option] = None
    return dict1


def connectMysql():
    config = configparser.ConfigParser()
    dbDir = os.path.dirname(
        os.path.abspath(inspect.getfile(inspect.currentframe()))
    )
    config.read(dbDir + '/config.ini')

    ConfigMap = ConfigSectionMap('DB', config)
    mHost = str(ConfigMap['host'])
    mPort = int(ConfigMap['port'])
    mUser = str(ConfigMap['user'])
    mPasswd = str(ConfigMap['passwd'])
    mDb = str(ConfigMap['db'])

    conn = pymysql.connect(host=mHost, port=mPort, user=mUser,
                           passwd=mPasswd, db=mDb, charset='UTF8')
    return conn

5a435e17cc6b419c5a270d234c8fed8866599286
<mask token>


def ConfigSectionMap(section, config):
    dict1 = {}
    options = config.options(section)
    for option in options:
        try:
            dict1[option] = config.get(section, option)
            if dict1[option] == -1:
                print('skip: %s' % option)
        except Exception:
            print('exception on %s!' % option)
            dict1[option] = None
    return dict1


<mask token>

<mask token>


def ConfigSectionMap(section, config):
    dict1 = {}
    options = config.options(section)
    for option in options:
        try:
            dict1[option] = config.get(section, option)
            if dict1[option] == -1:
                print('skip: %s' % option)
        except Exception:
            print('exception on %s!' % option)
            dict1[option] = None
    return dict1


def connectMysql():
    config = configparser.ConfigParser()
    dbDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.
        currentframe())))
    config.read(dbDir + '/config.ini')
    ConfigMap = ConfigSectionMap('DB', config)
    mHost = str(ConfigMap['host'])
    mPort = int(ConfigMap['port'])
    mUser = str(ConfigMap['user'])
    mPasswd = str(ConfigMap['passwd'])
    mDb = str(ConfigMap['db'])
    conn = pymysql.connect(host=mHost, port=mPort, user=mUser, passwd=
        mPasswd, db=mDb, charset='UTF8')
    return conn

<mask token>
sys.path.append(os.path.abspath(os.getcwd() + '/database'))


def ConfigSectionMap(section, config):
    dict1 = {}
    options = config.options(section)
    for option in options:
        try:
            dict1[option] = config.get(section, option)
            if dict1[option] == -1:
                print('skip: %s' % option)
        except Exception:
            print('exception on %s!' % option)
            dict1[option] = None
    return dict1


def connectMysql():
    config = configparser.ConfigParser()
    dbDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.
        currentframe())))
    config.read(dbDir + '/config.ini')
    ConfigMap = ConfigSectionMap('DB', config)
    mHost = str(ConfigMap['host'])
    mPort = int(ConfigMap['port'])
    mUser = str(ConfigMap['user'])
    mPasswd = str(ConfigMap['passwd'])
    mDb = str(ConfigMap['db'])
    conn = pymysql.connect(host=mHost, port=mPort, user=mUser, passwd=
        mPasswd, db=mDb, charset='UTF8')
    return conn

import configparser
import os
import inspect
import sys
import pymysql
sys.path.append(os.path.abspath(os.getcwd() + '/database'))


def ConfigSectionMap(section, config):
    dict1 = {}
    options = config.options(section)
    for option in options:
        try:
            dict1[option] = config.get(section, option)
            if dict1[option] == -1:
                print('skip: %s' % option)
        except Exception:
            print('exception on %s!' % option)
            dict1[option] = None
    return dict1


def connectMysql():
    config = configparser.ConfigParser()
    dbDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.
        currentframe())))
    config.read(dbDir + '/config.ini')
    ConfigMap = ConfigSectionMap('DB', config)
    mHost = str(ConfigMap['host'])
    mPort = int(ConfigMap['port'])
    mUser = str(ConfigMap['user'])
    mPasswd = str(ConfigMap['passwd'])
    mDb = str(ConfigMap['db'])
    conn = pymysql.connect(host=mHost, port=mPort, user=mUser, passwd=
        mPasswd, db=mDb, charset='UTF8')
    return conn

# encoding=utf-8
import configparser
import os
import inspect
import sys
import pymysql
sys.path.append(os.path.abspath(os.getcwd() + '/database'))


# from https://wiki.python.org/moin/ConfigParserExamples
def ConfigSectionMap(section, config):
    dict1 = {}
    options = config.options(section)
    for option in options:
        try:
            dict1[option] = config.get(section, option)
            if dict1[option] == -1:
                print("skip: %s" % option)
        except Exception:
            print("exception on %s!" % option)
            dict1[option] = None
    return dict1


def connectMysql():
    config = configparser.ConfigParser()
    dbDir = os.path.dirname(
        os.path.abspath(inspect.getfile(inspect.currentframe()))
    )
    config.read(dbDir + '/config.ini')

    ConfigMap = ConfigSectionMap('DB', config)
    mHost = str(ConfigMap['host'])
    mPort = int(ConfigMap['port'])
    mUser = str(ConfigMap['user'])
    mPasswd = str(ConfigMap['passwd'])
    mDb = str(ConfigMap['db'])

    conn = pymysql.connect(host=mHost, port=mPort, user=mUser,
                           passwd=mPasswd, db=mDb, charset='UTF8')
    return conn
