diff --git a/kivyblocks/hostimage.py b/kivyblocks/hostimage.py index 156b006..3e1f99f 100644 --- a/kivyblocks/hostimage.py +++ b/kivyblocks/hostimage.py @@ -1,6 +1,6 @@ import tempfile from kivyblocks.baseWidget import HTTPDataHandler -from kivyblocks.utils import blocksImage, absurl +from kivyblocks.utils import blockImage, absurl from kivy.uix.image import Image @@ -8,7 +8,7 @@ class HostImage(Image): def __init__(self, target,**kwargs): self.options = kwargs self.target = target - kwargs['source'] = blocksImage('running.gif') + kwargs['source'] = blockImage('running.gif') url = kwargs.get('url') del kwargs['url'] super().__init__(**kwargs) @@ -22,14 +22,14 @@ class HostImage(Image): loader.handle() def showBadImage(self,o,e): - self.source = blocksImage('break.png') + self.source = blockImage('broken.png') def createTmpfile(self,o,resp): fn = tempfile.NamedTemporaryFile(delete=True) with open(fn, 'wb') as f: - for chunk in r.iter_content(chunk_size=8192): - if chunk: # filter out keep-alive new chunks - f.write(chunk) - # f.flush() + for chunk in r.iter_content(chunk_size=8192): + if chunk: # filter out keep-alive new chunks + f.write(chunk) + # f.flush() self.source = fn diff --git a/kivyblocks/imgs/broken.png b/kivyblocks/imgs/broken.png new file mode 100644 index 0000000..b8f4741 Binary files /dev/null and b/kivyblocks/imgs/broken.png differ diff --git a/kivyblocks/threadcall.py b/kivyblocks/threadcall.py index ea8c73f..4d4c404 100644 --- a/kivyblocks/threadcall.py +++ b/kivyblocks/threadcall.py @@ -92,7 +92,7 @@ class HttpClient: def _webcall(self,url,method="GET", params={}, files={}, - headers={} + headers={}, stream=False): app = App.get_running_app() domain = self.url2domain(url)