Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def remove(self, pool_name, *missions):
"""Wrap mission_manager.remove."""
for mission in missions:
if mission.state in ("DOWNLOADING", "ANALYZING"):
messagebox.showerror("Comic Crawler", "刪除任務失敗!任務使用中")
mission_manager.remove(pool_name, *missions)
def cleanfinished():
# mission_manager.clean_finished()
missions = mission_manager.get_all("view", lambda m: m.state == "FINISHED")
if not missions:
return
mission_manager.remove("view", *missions)
print("移除 " + ", ".join(mission.title for mission in missions))
self.btn_clean["command"] = cleanfinished
def _(event):
mission = event.data
init_episode(mission)
if len(mission.episodes) == 1:
uninit_episode(mission)
return
if not select_episodes(self.root, mission):
mission_manager.remove("view", mission)
def cleanfinished():
# mission_manager.clean_finished()
missions = mission_manager.get_by_state("view", ("FINISHED",), all=True)
if not missions:
return
mission_manager.remove("view", *missions)
print("移除 " + ", ".join(mission.title for mission in missions))
self.btn_clean["command"] = cleanfinished