diff options
author | 2012-08-08 12:20:33 +0200 | |
---|---|---|
committer | 2012-08-08 12:20:33 +0200 | |
commit | 012446580679e87e8222b1d2391aa8501377bfa3 (patch) | |
tree | 354f555e116764a65d24d6580036f685ce7fa96f /pym | |
parent | euscanwww: Improved forms UI, added preferences page and change password (diff) | |
download | euscan-012446580679e87e8222b1d2391aa8501377bfa3.tar.gz euscan-012446580679e87e8222b1d2391aa8501377bfa3.tar.bz2 euscan-012446580679e87e8222b1d2391aa8501377bfa3.zip |
euscan: Improving Berlios and Sourceforge handlers
Signed-off-by: volpino <fox91@anche.no>
Diffstat (limited to 'pym')
-rw-r--r-- | pym/euscan/handlers/berlios.py | 9 | ||||
-rw-r--r-- | pym/euscan/handlers/sourceforge.py | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/pym/euscan/handlers/berlios.py b/pym/euscan/handlers/berlios.py index 9667e77..9f716de 100644 --- a/pym/euscan/handlers/berlios.py +++ b/pym/euscan/handlers/berlios.py @@ -9,11 +9,14 @@ from euscan import output HANDLER_NAME = "berlios" CONFIDENCE = 90 -PRIORITY = 95 +PRIORITY = 90 + + +berlios_regex = r"berlios.de/([^/]+)/([^/]+)" def can_handle(pkg, url=None): - return url and "berlios.de/" in url + return url and re.search(berlios_regex, url) def scan_url(pkg, url, options): @@ -21,7 +24,7 @@ def scan_url(pkg, url, options): cp, ver, rev = portage.pkgsplit(pkg.cpv) - project, filename = re.search(r"berlios.de/(.+)/(.+)", url).groups() + project, filename = re.search(berlios_regex, url).groups() project_page = "http://developer.berlios.de/projects/%s" % project content = urllib.urlopen(project_page).read() diff --git a/pym/euscan/handlers/sourceforge.py b/pym/euscan/handlers/sourceforge.py index 8925a6d..df80863 100644 --- a/pym/euscan/handlers/sourceforge.py +++ b/pym/euscan/handlers/sourceforge.py @@ -20,7 +20,8 @@ def scan_url(pkg, url, options): cp, ver, rev = portage.pkgsplit(pkg.cpv) - project, filename = re.search("sourceforge.net/(.+)/(.+)", url).groups() + project, filename = re.search("sourceforge.net/([^/]+)/(?:.*/)?([^/]+)", + url).groups() base_url = "http://qa.debian.org/watch/sf.php/%s" % project file_pattern = regex_from_template( filename.replace(ver, "${PV}") |