Exemple #1
0
 def __init__(self, getOption):
     useRegexp = int(getOption("use_regexp", "1"))
     searchStr = getOption("search_string").replace("\\n", "\n")
     self.textTrigger = plugins.MultilineTextTrigger(searchStr, useRegexp)
     self.triggerHosts = self.getTriggerHosts(getOption)
     self.checkUnchanged = int(getOption("trigger_on_success", "0"))
     self.reportInternalError = int(getOption("internal_error", "0"))
     self.ignoreOtherErrors = int(getOption("ignore_other_errors", self.reportInternalError))
     self.customTrigger = getOption("custom_trigger", "")
     self.bugInfo = self.createBugInfo(getOption)
     self.diag = logging.getLogger("Check For Bugs")
Exemple #2
0
 def __init__(self, args):
     argDict = self.parseArguments(args, [
         "old", "new", "file", "regexp", "argsReplacement",
         "includeShortcuts"
     ])
     tryAsRegexp = "regexp" not in argDict or argDict["regexp"] == "1"
     self.argsReplacement = "argsReplacement" in argDict and argDict[
         "argsReplacement"] == "1"
     self.oldText = argDict["old"].replace("\\n", "\n")
     self.newText = argDict["new"].replace("\\n", "\n")
     if self.newText.endswith("\n") and self.oldText.endswith("\n"):
         self.oldText = self.oldText.rstrip()
     self.newText = self.newText.rstrip()
     self.trigger = plugins.MultilineTextTrigger(
         self.oldText, tryAsRegexp,
         False) if not self.argsReplacement else plugins.TextTrigger(
             self.oldText, tryAsRegexp, False)
     self.newMultiLineText = self.newText.split("\n")
     self.stems = []
     fileStr = argDict.get("file")
     if fileStr:
         self.stems = plugins.commasplit(fileStr)
     self.includeShortcuts = "includeShortcuts" in argDict and argDict[
         "includeShortcuts"] == "1"