def color_update(self, bytedata):
"""Launch new calculation process with given image bytedata"""
if bytedata is None:
if self.default is None:
if not self.config["image"]["default"].endswith(".svg"): # fix this
file_ = self.config["image"]["default"]
self.handler_unblock(self.catcher)
else:
return
else:
self.emit("ac-update", self.default)
return
else:
file_ = io.BytesIO(bytedata)
if self.process is None or not self.process.is_alive():
if self.watcher is None:
self.watcher = GLib.io_add_watch(self.pc, GLib.IO_IN | GLib.IO_HUP, self.color_setup)
self.process = multiprocessing.Process(
target=self.calculate, args=(file_, self.config["autocolor"], self.cc)
)
self.process.start()
else:
logger.error("Autocolor threading error: previus process still running, refusing to start new one")
评论列表
文章目录