admin_dash.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:smartschool 作者: asifkodur 项目源码 文件源码
def on_import_db(self, event):  # wxGlade: admin_dash.<event_handler>
        '''
        msg="This feature is suspended"
        dlg = wx.MessageDialog(self, msg, '',wx.OK | wx.ICON_INFORMATION)                  
        dlg.ShowModal()
        dlg.Destroy()
        return 0
        '''





        msg="Importing may overwrite some of the existing data \n Do you want to continue?"
        dlg = wx.MessageDialog(self, msg)#,wx.SAVE|wx.ICON_QUESTION)            
        if dlg.ShowModal() == wx.ID_OK:


            dir = "/home"



            wcd="Exam Files(*.xam)|*.xam|"
            open_dlg = wx.FileDialog(self, message='Choose a file', defaultDir=dir, defaultFile='',  wildcard=wcd, style=wx.OPEN|wx.CHANGE_DIR)
            if open_dlg.ShowModal() == wx.ID_OK:

                path = open_dlg.GetPath()                

                try:   


                    self.DB.import_(path)
                    dlg = wx.MessageDialog(self, 'Successfully imported', '',wx.OK | wx.ICON_INFORMATION)    


                except:
                    dlg = wx.MessageDialog(self, 'Sorry, Could not import', '',wx.OK | wx.ICON_ERROR)    

                dlg.ShowModal()
                dlg.Destroy()




        self.label_import_db.SetForegroundColour(self.label_fg_color)
        event.Skip()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号