diff options
author | volpino <fox91@anche.no> | 2012-07-25 10:19:27 +0200 |
---|---|---|
committer | Corentin Chary <corentin.chary@gmail.com> | 2012-07-25 16:53:17 +0200 |
commit | 9f164ed22c55a17e641ff2e9107116fa67af3035 (patch) | |
tree | d6b94192c08c79a53c234dbd203c3626e4701177 /pym | |
parent | euscan: Added watch handler, fixed generic one (diff) | |
download | euscan-9f164ed22c55a17e641ff2e9107116fa67af3035.tar.gz euscan-9f164ed22c55a17e641ff2e9107116fa67af3035.tar.bz2 euscan-9f164ed22c55a17e641ff2e9107116fa67af3035.zip |
euscanwww: Removing useless stuff while creating watch tag
* Removing useless options or actions
* Fixing handling of substitution regex
Signed-off-by: volpino <fox91@anche.no>
Diffstat (limited to 'pym')
-rw-r--r-- | pym/euscan/handlers/watch.py | 4 |
1 files changed, 4 insertions, 0 deletions
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) |