aboutsummaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorvolpino <fox91@anche.no>2012-07-25 10:19:27 +0200
committerCorentin Chary <corentin.chary@gmail.com>2012-07-25 16:53:17 +0200
commit9f164ed22c55a17e641ff2e9107116fa67af3035 (patch)
treed6b94192c08c79a53c234dbd203c3626e4701177 /pym
parenteuscan: Added watch handler, fixed generic one (diff)
downloadeuscan-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.py4
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)