Exemple #1
0
 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())
Exemple #2
0
 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")
Exemple #3
0
 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")
Exemple #4
0
 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")