def OnDeleteButton(self, event):
filepath = self.ManagedDir.GetPath()
if os.path.isfile(filepath):
folder, filename = os.path.split(filepath)
dialog = wx.MessageDialog(self,
_("Do you really want to delete the file '%s'?") % filename,
_("Delete File"),
wx.YES_NO | wx.ICON_QUESTION)
remove = dialog.ShowModal() == wx.ID_YES
dialog.Destroy()
if remove:
os.remove(filepath)
self.ManagedDir.RefreshTree()
event.Skip()
评论列表
文章目录