1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-23 18:52:10 +01:00

Move urlparse import where it belongs.

This commit is contained in:
Michal Čihař 2010-12-01 10:17:12 +01:00
parent 1a0cea8a4d
commit fbfb098a7d

View File

@ -4495,12 +4495,12 @@ def streamfile(url, http_meth = http_GET, bufsize=8192, data=None, progress_obj=
caller. caller.
""" """
f = http_meth.__call__(url, data = data) f = http_meth.__call__(url, data = data)
import urlparse
cl = f.info().get('Content-Length') cl = f.info().get('Content-Length')
if cl is not None: if cl is not None:
cl = int(cl) cl = int(cl)
if progress_obj: if progress_obj:
import urlparse
basename = os.path.basename(urlparse.urlsplit(url)[2]) basename = os.path.basename(urlparse.urlsplit(url)[2])
progress_obj.start(basename=basename, text=text, size=cl) progress_obj.start(basename=basename, text=text, size=cl)
data = f.read(bufsize) data = f.read(bufsize)