mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-23 10:42:14 +01:00
Move urlparse import where it belongs.
This commit is contained in:
parent
1a0cea8a4d
commit
fbfb098a7d
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user