From 9f164ed22c55a17e641ff2e9107116fa67af3035 Mon Sep 17 00:00:00 2001 From: volpino Date: Wed, 25 Jul 2012 10:19:27 +0200 Subject: euscanwww: Removing useless stuff while creating watch tag * Removing useless options or actions * Fixing handling of substitution regex Signed-off-by: volpino --- pym/euscan/handlers/watch.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pym') diff --git a/pym/euscan/handlers/watch.py b/pym/euscan/handlers/watch.py index d172072..a129281 100644 --- a/pym/euscan/handlers/watch.py +++ b/pym/euscan/handlers/watch.py @@ -26,7 +26,11 @@ def can_handle(pkg, url): def parse_mangles(mangles, string): for mangle in mangles: # convert regex from perl format to python format + # there are some regex in this format: s/pattern/replacement/ m = re.match(r"s/(.*[^\\])/(.*)/", mangle) + if not m: + # or in this format s|pattern|replacement| + m = re.match(r"s\|(.*[^\\])\|(.*)\|", mangle) pattern, repl = m.groups() repl = re.sub(r"\$(\d+)", r"\\\1", repl) string = re.sub(pattern, repl, string) -- cgit v1.2.3-65-gdbad