#!/usr/bin/python3
# coding=utf-8

import sys
import os
import inspect
import configparser
from util import configSectionMap
from peewee import MySQLDatabase, Model

# read database config file
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 = MySQLDatabase(mDb, host=mHost, port=mPort, user=mUser, passwd=mPasswd)


class BaseModel(Model):
    class Meta:
        database = conn


def connectMysql():
    conn.connect()


def closeConnect():
    conn.close()

ecbcced37b4f9b941042178d23111f67c5ae9145
<mask token>


class BaseModel(Model):


    class Meta:
        database = conn


<mask token>

<mask token>
config.read(dbDir + '/config.ini')
<mask token>


class BaseModel(Model):


    class Meta:
        database = conn


def connectMysql():
    conn.connect()


def closeConnect():
    conn.close()

<mask token>
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 = MySQLDatabase(mDb, host=mHost, port=mPort, user=mUser, passwd=mPasswd)


class BaseModel(Model):


    class Meta:
        database = conn


def connectMysql():
    conn.connect()


def closeConnect():
    conn.close()

import sys
import os
import inspect
import configparser
from util import configSectionMap
from peewee import MySQLDatabase, Model
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 = MySQLDatabase(mDb, host=mHost, port=mPort, user=mUser, passwd=mPasswd)


class BaseModel(Model):


    class Meta:
        database = conn


def connectMysql():
    conn.connect()


def closeConnect():
    conn.close()

#!/usr/bin/python3
# coding=utf-8

import sys
import os
import inspect
import configparser
from util import configSectionMap
from peewee import MySQLDatabase, Model

# read database config file
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 = MySQLDatabase(mDb, host=mHost, port=mPort, user=mUser, passwd=mPasswd)


class BaseModel(Model):
    class Meta:
        database = conn


def connectMysql():
    conn.connect()


def closeConnect():
    conn.close()
