def OnReplace(self, evt): details = self.GetFindDetails(True) if details: try: if not details.Replace(self.editor): dialogs.info(self, "Pattern not found: '%s'" % details.find, "Replace") except re.error as e: dialogs.error(self, "Error: %s." % str(e).capitalize())
def OnReplaceAll(self, evt): details = self.GetFindDetails(True) if not details: return count = details.ReplaceAll(self.editor) if count > 0: dialogs.info(self, "Replaced %d instances of '%s'" % (count, details.find), "Replace All") else: dialogs.info(self, "Pattern not found: '%s'" % details.find, "Replace All")
def OnReplaceAll(self, evt): details = self.GetFindDetails(True) if not details: return try: count = details.ReplaceAll(self.editor) except re.error as e: dialogs.error(self, "Error: %s." % str(e).capitalize()) else: if count > 0: dialogs.info(self, "Replaced %d instances of '%s'" % (count, details.find), "Replace All") else: dialogs.info(self, "Pattern not found: '%s'" % details.find, "Replace All")
def OnReplace(self, evt): details = self.GetFindDetails(True) if details and not details.Replace(self.editor): dialogs.info(self, "Pattern not found: '%s'" % details.find, "Replace")