X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bbf7159c8211a398e573122c66b93722f5125c60..a97cefbabff29c566c0859d3e735c79a6f3032b6:/wxPython/wx/lib/docview.py diff --git a/wxPython/wx/lib/docview.py b/wxPython/wx/lib/docview.py index 5a2a46ad50..a945a14969 100644 --- a/wxPython/wx/lib/docview.py +++ b/wxPython/wx/lib/docview.py @@ -215,16 +215,13 @@ class Document(wx.EvtHandler): self._documentModified = modify - def SetDocumentModificationDate(self, filename=None): + def SetDocumentModificationDate(self): """ Saves the file's last modification date. This is used to check if the file has been modified outside of the application. This method has been added to wxPython and is not in wxWindows. """ - if not filename: - filename = self.GetFilename() - self._documentModificationDate = os.path.getmtime(filename) - print "debug print, file: %s set modification date to %s" % (filename, self._documentModificationDate) + self._documentModificationDate = os.path.getmtime(self.GetFilename()) def GetDocumentModificationDate(self): @@ -365,7 +362,6 @@ class Document(wx.EvtHandler): """ check for file modification outside of application """ if os.path.exists(self.GetFilename()) and os.path.getmtime(self.GetFilename()) != self.GetDocumentModificationDate(): - print "debug print, File %s: new mod date %s, original mod date %s" % (self.GetFilename(), os.path.getmtime(self.GetFilename()), self.GetDocumentModificationDate()) msgTitle = wx.GetApp().GetAppName() if not msgTitle: msgTitle = _("Application") @@ -468,6 +464,7 @@ class Document(wx.EvtHandler): if backupFilename: os.remove(filename) os.rename(backupFilename, filename) + self.SetDocumentModificationDate() wx.MessageBox("Could not save '%s'. %s" % (FileNameFromPath(filename), sys.exc_value), msgTitle, @@ -596,7 +593,6 @@ class Document(wx.EvtHandler): """ check for file modification outside of application """ if os.path.exists(self.GetFilename()) and os.path.getmtime(self.GetFilename()) != self.GetDocumentModificationDate(): - print "debug print, File %s: new mod date %s, original mod date %s" % (self.GetFilename(), os.path.getmtime(self.GetFilename()), self.GetDocumentModificationDate()) msgTitle = wx.GetApp().GetAppName() if not msgTitle: msgTitle = _("Warning")