tools/web: factorize getNormalizedURL

This commit is contained in:
nemunaire 2015-10-14 00:17:02 +02:00
commit 55e6550cb1
7 changed files with 26 additions and 21 deletions

View file

@ -3,6 +3,7 @@ import urllib
from nemubot import __version__
from nemubot.exception import IRCException
from nemubot.tools.web import getNormalizedURL
def validator(url):
"""Run the w3c validator on the given URL
@ -11,7 +12,7 @@ def validator(url):
url -- the URL to validate
"""
o = urllib.parse.urlparse(url, "http")
o = urllib.parse.urlparse(getNormalizedURL(url), "http")
if o.netloc == "":
raise IRCException("Indicate a valid URL!")