#!/usr/bin/python # -*- coding: GBK -*- # ##@package # # @todo: Êý¾Ý¿â-¼È봫ͳÇþµÀɾµµÍæ¼ÒµÄ³äÖµ·µÀû 1Ôª=20ÏÉÓñ # # @author: Alee # @date 2019-1-22 ÏÂÎç03:13:42 # @version 1.0 # # @note: # #--------------------------------------------------------------------- from lib import DBController from lib import mylog g_dbController = None def InitDB(): global g_dbController if not g_dbController: IP = "127.0.0.1" Port = 27017 User = "sa" Pwd = "sa" DBName = "DoubleBillDB" g_dbController = DBController.DBController(IP, Port, DBName, User, Pwd, None) mylog.debug('»ñȡеÄÊý¾Ý¿âÁ´½Ó') if not g_dbController.connected: mylog.debug('ÎÞ·¨Á´½ÓÊý¾Ý¿â') return False return True def GetDBEventCon(): global g_dbController if not InitDB(): return None return g_dbController