def makeParam(): paramDic = jTool.getConfigParam(['hostSvr', 'dbHost', 'dbUser', 'dbPasswd', 'rdb', 'basePostUrl', 'preUrl', 'basePostUrlip', 'preUrlip'], 'config.ini') conn = jTool.initCursor(paramDic['dbHost'], paramDic['dbUser'], paramDic['dbPasswd'], paramDic['rdb']) paramDic['conn'] = conn return paramDic
def __init__(self): paramDic = jTool.getConfigParam(['host', 'user', 'passwd', 'db'], 'server.ini') conn = jTool.initCursor(paramDic['host'], paramDic['user'], paramDic['passwd'], paramDic['db']) self.conn = conn
# -*-coding: utf-8 -*- #encoding=utf-8 import sys import jTool reload(sys) sys.setdefaultencoding("utf-8") #初始化任务表用,每个任务跑一次就可以 paramDic = jTool.getConfigParam(['host', 'user', 'passwd', 'db', 'initTable'], 'server.ini') conn = jTool.initCursor(paramDic['host'], paramDic['user'], paramDic['passwd'], paramDic['db']) jTool.initTaskTable(conn, paramDic['initTable'])
def getParam(): param = jTool.getConfigParam(['lHeader', 'rHeader', 'url'], 'router.ini') param['lHeader'] = eval('['+param['lHeader']+']') param['rHeader'] = eval('['+param['rHeader']+']') return param