def __init__(self, cmd, args = '', niceCmd = None, niceArgs = None, shell = True): self.niceCmd = QM(niceCmd, niceCmd, os.path.basename(cmd)) self.niceArgs = QM(niceArgs, niceArgs, args) (self.stdout, self.stderr, self.cmd, self.args) = ([], [], cmd, args) self._logger = logging.getLogger('process.%s' % os.path.basename(cmd).lower()) self._logger.log(logging.DEBUG1, 'External programm called: %s %s', self.niceCmd, self.niceArgs) self.stime = time.time() if shell: self.proc = python_compat_popen2.Popen3('%s %s' % (cmd, args), True) else: if isinstance(cmd, str): cmd = [cmd] if isinstance(args, str): args = args.split() self.proc = python_compat_popen2.Popen3( cmd + list(args), True)
def matcher(self, value, selector): if not self._case: value = value.lower() selector = selector.lower() return QM(self.__class__.matchFunction(value, selector), 1, -1)
def match(self, value): if not self._case: value = value.lower() return QM(self._regex.search(value) is not None, 1, -1)
def matcher(self, value, selector): if not self._case: value = value.lower() return QM(re.search(selector, value) is not None, 1, -1)
def match(self, value): if not self._case: value = value.lower() return QM(self._matcher(value), 1, -1)
def matcher(self, value, selector): if not self._case: value = value.lower() selector = selector.lower() return QM(ExprMatcher.getExpr(selector)(value), 1, -1)
def match(self, value): if not self._case: value = value.lower() return QM(matcher(value, self._selector), 1, -1)
def match(self, value): return QM( self._regex.search(getCase(self._case, value)) is not None, 1, -1)
def matcher(self, value, selector): return QM( re.search(getCase(self._case_regex, selector), getCase(self._case, value)) is not None, 1, -1)
def match(self, value): return QM(self._matcher(getCase(self._case, value)), 1, -1)
def matcher(self, value, selector): return QM( ExprMatcher.getExpr(getCase(self._case, selector))(getCase(self._case, value)), 1, -1)
def match(self, value): return QM(matcher(getCase(self._case, value), self._selector), 1, -1)
def matcher(self, value, selector): return QM( self.__class__.matchFunction(getCase(self._case, value), getCase(self._case, selector)), 1, -1)