Downloader: replace import of urlparser
authorlittlesat <littlesat99@yahoo.com>
Sun, 7 Sep 2014 15:08:23 +0000 (17:08 +0200)
committerlittlesat <littlesat99@yahoo.com>
Sun, 7 Sep 2014 15:09:17 +0000 (17:09 +0200)
Not smart to "import" it at each call.

lib/python/Tools/Downloader.py

index 15083d6..fe86eac 100644 (file)
@@ -1,6 +1,7 @@
 from twisted.web import client
 from twisted.internet import reactor, defer
 from twisted.python import failure
+from urlparse import urlparse
 
 class HTTPProgressDownloader(client.HTTPDownloader):
        def __init__(self, url, outfile, headers=None):
@@ -37,7 +38,6 @@ class HTTPProgressDownloader(client.HTTPDownloader):
 
 class downloadWithProgress:
        def __init__(self, url, outputfile, contextFactory=None, *args, **kwargs):
-               from urlparse import urlparse
                parsed = urlparse(url)
                scheme = parsed.scheme
                host = parsed.hostname