Mercurial > libervia-backend
diff sat_frontends/bridge/pb.py @ 3066:2cc2f65379f7
core: added imageCheck and imageResize methods:
imageCheck will give a report on image, notably it will tell if it's too big and needs to
be resized before a transfer.
imageResize will create a new image with the requested size and return a path to it.
author | Goffi <goffi@goffi.org> |
---|---|
date | Tue, 29 Oct 2019 20:38:39 +0100 |
parents | 84bb63e1e4c4 |
children | 130f9cb6e0ab |
line wrap: on
line diff
--- a/sat_frontends/bridge/pb.py Tue Oct 29 20:24:29 2019 +0100 +++ b/sat_frontends/bridge/pb.py Tue Oct 29 20:38:39 2019 +0100 @@ -375,6 +375,22 @@ errback = self._generic_errback d.addErrback(errback) + def imageCheck(self, arg_0, callback=None, errback=None): + d = self.root.callRemote("imageCheck", arg_0) + if callback is not None: + d.addCallback(callback) + if errback is None: + errback = self._generic_errback + d.addErrback(errback) + + def imageResize(self, image_path, width, height, callback=None, errback=None): + d = self.root.callRemote("imageResize", image_path, width, height) + if callback is not None: + d.addCallback(callback) + if errback is None: + errback = self._generic_errback + d.addErrback(errback) + def isConnected(self, profile_key="@DEFAULT@", callback=None, errback=None): d = self.root.callRemote("isConnected", profile_key) if callback is not None: @@ -773,6 +789,16 @@ d.addErrback(self._errback) return d.asFuture(asyncio.get_event_loop()) + def imageCheck(self, arg_0): + d = self.root.callRemote("imageCheck", arg_0) + d.addErrback(self._errback) + return d.asFuture(asyncio.get_event_loop()) + + def imageResize(self, image_path, width, height): + d = self.root.callRemote("imageResize", image_path, width, height) + d.addErrback(self._errback) + return d.asFuture(asyncio.get_event_loop()) + def isConnected(self, profile_key="@DEFAULT@"): d = self.root.callRemote("isConnected", profile_key) d.addErrback(self._errback)