Commit 8fb3c29a authored by Łukasz Nowak's avatar Łukasz Nowak

Simplify imports

parent 27cdcb1c
...@@ -19,8 +19,8 @@ import httplib ...@@ -19,8 +19,8 @@ import httplib
import json import json
import os import os
import tempfile import tempfile
from urllib import urlretrieve import urllib
from urlparse import urlparse import urlparse
class NetworkcacheClient(object): class NetworkcacheClient(object):
...@@ -33,7 +33,7 @@ class NetworkcacheClient(object): ...@@ -33,7 +33,7 @@ class NetworkcacheClient(object):
def parseUrl(self, url): def parseUrl(self, url):
return_dict = {} return_dict = {}
parsed_url = urlparse(url) parsed_url = urlparse.urlparse(url)
return_dict['header_dict'] = {'Content-Type': 'application/json'} return_dict['header_dict'] = {'Content-Type': 'application/json'}
user = parsed_url.username user = parsed_url.username
passwd = parsed_url.password passwd = parsed_url.password
...@@ -133,7 +133,7 @@ class NetworkcacheClient(object): ...@@ -133,7 +133,7 @@ class NetworkcacheClient(object):
''' '''
sha_cache_url = os.path.join(self.shacache_url, sha512sum) sha_cache_url = os.path.join(self.shacache_url, sha512sum)
file_descriptor = tempfile.NamedTemporaryFile() file_descriptor = tempfile.NamedTemporaryFile()
path, headers = urlretrieve(sha_cache_url, file_descriptor.name) path, headers = urllib.urlretrieve(sha_cache_url, file_descriptor.name)
file_descriptor.seek(0) file_descriptor.seek(0)
return file_descriptor return file_descriptor
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment