def btn_yesOnButtonClick(self, event): conn = DB_Setup() if conn.get_session(): conn.close_db() if not conn.get_session(): topframe = wx.GetApp().GetTopWindow() topframe.SetTitle(topframe.GetTitle().split(':')[0]) self.disconnectResult = True from Messages_forms.msg_infos import msg_infos msg_infos(topframe, msg='\nDatabase disconnected successfully\n\n"' + define.dbName + '" session has been disconnected').Show() else: from Messages_forms.msg_somethigWrong import msg_somethigWrong msg_somethigWrong(None, msg='"' + define.dbName + '"database disconnection failed').Show() else: from Messages_forms.msg_somethigWrong import msg_somethigWrong msg_somethigWrong(None, msg='No "' + define.dbName + '" Connection Found').Show() self.Close()
def disconnect_DB(self): conn = DB_Setup() if conn.get_session(): conn.close_db()