本文整理汇总了Python中MaKaC.plugins.RoomBooking.default.dalManager.DALManager.disconnect方法的典型用法代码示例。如果您正苦于以下问题:Python DALManager.disconnect方法的具体用法?Python DALManager.disconnect怎么用?Python DALManager.disconnect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MaKaC.plugins.RoomBooking.default.dalManager.DALManager
的用法示例。
在下文中一共展示了DALManager.disconnect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _run
# 需要导入模块: from MaKaC.plugins.RoomBooking.default.dalManager import DALManager [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.dalManager.DALManager import disconnect [as 别名]
def _run(args):
_setup(args)
formatter = logging.Formatter("%(asctime)s %(name)s - %(levelname)s %(filename)s:%(lineno)s: %(message)s")
root = logging.getLogger('')
handler = logging.StreamHandler()
handler.setFormatter(formatter)
root.addHandler(handler)
dbi = DBMgr.getInstance(max_disconnect_poll=40)
dbi.startRequest()
info = HelperMaKaCInfo.getMaKaCInfoInstance()
useRBDB = info.getRoomBookingModuleActive()
if useRBDB:
DALManager.connect()
sm = SchedulerModule.getDBInstance()
t = sm.getTaskById(args.taskid)
t.plugLogger(logging.getLogger('console.run/%s' % args.taskid))
t.run()
if useRBDB:
DALManager.commit()
DALManager.disconnect()
dbi.endRequest()
示例2: main
# 需要导入模块: from MaKaC.plugins.RoomBooking.default.dalManager import DALManager [as 别名]
# 或者: from MaKaC.plugins.RoomBooking.default.dalManager.DALManager import disconnect [as 别名]
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--location', '-l', action='append', dest='locations')
args = parser.parse_args()
with DBMgr.getInstance().global_connection():
DALManager.connect()
try:
_main(args)
finally:
DALManager.disconnect()