| Conditions | 3 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | #!/usr/bin/env python |
||
| 21 | @cherrypy.expose |
||
| 22 | def gif(self, camera): |
||
| 23 | if camera not in self.service.cameras.keys(): |
||
| 24 | raise cherrypy.HTTPError(404, "Camera not found") |
||
| 25 | camobject = self.service.cameras[camera] |
||
| 26 | # obtain a temporary lock to copy the buffer |
||
| 27 | with camobject["lock"]: |
||
| 28 | x = copy.copy(camobject["buffer"]) |
||
| 29 | imageio.mimsave("test.gif", x, 'GIF', duration=2) |
||
| 30 | return self.service.cameras.keys() |
||
| 31 | |||
| 35 |