aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <proyvind@moondrake.org>2016-06-01 14:56:46 +0200
committerPer Øyvind Karlsen <proyvind@moondrake.org>2016-06-01 14:56:46 +0200
commita6c6cedd46157ef311556da3a1c412c65950c152 (patch)
tree8b96d7d699e07f928c8bea876e9b09d1f2360421 /MgaRepo
parent12db22b6c9de3e9ea4ca2b6246f6abfd1b66818b (diff)
downloadmgarepo-a6c6cedd46157ef311556da3a1c412c65950c152.tar
mgarepo-a6c6cedd46157ef311556da3a1c412c65950c152.tar.gz
mgarepo-a6c6cedd46157ef311556da3a1c412c65950c152.tar.bz2
mgarepo-a6c6cedd46157ef311556da3a1c412c65950c152.tar.xz
mgarepo-a6c6cedd46157ef311556da3a1c412c65950c152.zip
add an additional check to verify username against html page of
Diffstat (limited to 'MgaRepo')
-rw-r--r--MgaRepo/log.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/MgaRepo/log.py b/MgaRepo/log.py
index 126e8c0..5c2a56d 100644
--- a/MgaRepo/log.py
+++ b/MgaRepo/log.py
@@ -565,6 +565,7 @@ from html.parser import HTMLParser
class TagParser(HTMLParser):
li = False
ahref = False
+ userpage = None
namepat = re.compile("(?P<name>.*?)\s*\((?P<user>.*?)\)")
def handle_starttag(self, tag, attrs):
@@ -574,17 +575,19 @@ class TagParser(HTMLParser):
for att in attrs:
if att[0] == "href":
self.ahref = True
+ self.userpage = att[1]
def handle_endtag(self, tag):
if self.li and tag == "a":
self.ahref = False
+ self.userpage = None
if tag == "li":
self.li = False
def handle_data(self, data):
if self.li and self.ahref:
found = self.namepat.match(data)
- if found and found.group("user") and found.group("name"):
+ if found and found.group("user") and found.group("name") and found.group("user")+".html" == self.userpage:
usermap[found.group("user")] = "%s <%s@mageia.org>" % (found.group("name"), found.group("user"))
def _map_user_names():