diff src/cagou/core/image.py @ 101:d5ede9281e4c

core (image): AsyncImage now handle file:// schema in source
author Goffi <goffi@goffi.org>
date Thu, 05 Jan 2017 20:36:40 +0100
parents 56838ad5c84b
children
line wrap: on
line diff
--- a/src/cagou/core/image.py	Sat Dec 31 12:12:17 2016 +0100
+++ b/src/cagou/core/image.py	Thu Jan 05 20:36:40 2017 +0100
@@ -71,3 +71,14 @@
             if ci:
                 ci.bind(on_texture=self._on_tex_change)
                 self.texture = ci.texture
+
+
+class AsyncImage(kivy_img.AsyncImage):
+    """AsyncImage which accept file:// schema"""
+
+    def _load_source(self, *args):
+        if self.source.startswith('file://'):
+            self.source = self.source[7:]
+        else:
+            super(AsyncImage, self)._load_source(*args)
+