equal
deleted
inserted
replaced
559 ('all except for .po', r'.*(?<!\.po)$', '', |
559 ('all except for .po', r'.*(?<!\.po)$', '', |
560 allfilesfilters, allfilespats), |
560 allfilesfilters, allfilespats), |
561 ] |
561 ] |
562 |
562 |
563 def _preparepats(): |
563 def _preparepats(): |
564 for c in checks: |
564 def preparefailandwarn(failandwarn): |
565 failandwarn = c[-1] |
|
566 for pats in failandwarn: |
565 for pats in failandwarn: |
567 for i, pseq in enumerate(pats): |
566 for i, pseq in enumerate(pats): |
568 # fix-up regexes for multi-line searches |
567 # fix-up regexes for multi-line searches |
569 p = pseq[0] |
568 p = pseq[0] |
570 # \s doesn't match \n (done in two steps) |
569 # \s doesn't match \n (done in two steps) |
574 p = re.sub(r'(?<!(\\|\[))\\s', r'[ \\t]', p) |
573 p = re.sub(r'(?<!(\\|\[))\\s', r'[ \\t]', p) |
575 # [^...] doesn't match newline |
574 # [^...] doesn't match newline |
576 p = re.sub(r'(?<!\\)\[\^', r'[^\\n', p) |
575 p = re.sub(r'(?<!\\)\[\^', r'[^\\n', p) |
577 |
576 |
578 pats[i] = (re.compile(p, re.MULTILINE),) + pseq[1:] |
577 pats[i] = (re.compile(p, re.MULTILINE),) + pseq[1:] |
579 filters = c[3] |
578 |
|
579 def preparefilters(filters): |
580 for i, flt in enumerate(filters): |
580 for i, flt in enumerate(filters): |
581 filters[i] = re.compile(flt[0]), flt[1] |
581 filters[i] = re.compile(flt[0]), flt[1] |
|
582 |
|
583 for cs in (checks,): |
|
584 for c in cs: |
|
585 failandwarn = c[-1] |
|
586 preparefailandwarn(failandwarn) |
|
587 |
|
588 filters = c[-2] |
|
589 preparefilters(filters) |
582 |
590 |
583 class norepeatlogger(object): |
591 class norepeatlogger(object): |
584 def __init__(self): |
592 def __init__(self): |
585 self._lastseen = None |
593 self._lastseen = None |
586 |
594 |