Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print("page {} already exist".format(crawler.ep.total + 1))
crawler.next_image()
return
debug_log("D_RESOLVE")
crawler.resolve_image()
print("Downloading {} page {}: {}\n".format(
crawler.ep.title, crawler.ep.total + 1, crawler.image.url))
debug_log("D_DOWNLOAD")
crawler.download_image()
debug_log("D_HANDLE")
crawler.handle_image()
debug_log("D_SAVE")
crawler.save_image()
debug_log("D_PUB")
mission_ch.pub("MISSION_PROPERTY_CHANGED", crawler.mission)
debug_log("D_REST")
crawler.rest()
debug_log("D_NEXT_IMAGE")
crawler.next_image()
print("page {} already exist".format(crawler.ep.total + 1))
crawler.next_image()
return
debug_log("D_RESOLVE")
crawler.resolve_image()
print("Downloading {} page {}: {}\n".format(
crawler.ep.title, crawler.ep.total + 1, crawler.image.url))
debug_log("D_DOWNLOAD")
crawler.download_image()
debug_log("D_HANDLE")
crawler.handle_image()
debug_log("D_SAVE")
crawler.save_image()
debug_log("D_PUB")
mission_ch.pub("MISSION_PROPERTY_CHANGED", crawler.mission)
debug_log("D_REST")
crawler.rest()
debug_log("D_NEXT_IMAGE")
crawler.next_image()
ep_data["total"] += 1
episodes.append(Episode(**ep_data))
m_data["episodes"] = episodes
mission = create_mission(**m_data)
self.pool[mission.url] = mission
for url in view:
self.view[url] = self.pool[url]
for url in library:
self.library[url] = self.pool[url]
mission_ch.pub("MISSION_LIST_REARRANGED", self.view)
mission_ch.pub("MISSION_LIST_REARRANGED", self.library)
def __setattr__(self, name, value):
with mission_lock:
setattr(self.mission, name, value)
mission_ch.pub("MISSION_PROPERTY_CHANGED", self)
def __setattr__(self, name, value):
with mission_lock:
setattr(self.mission, name, value)
mission_ch.pub("MISSION_PROPERTY_CHANGED", self)
def drop(self, pool_name, *missions):
"""Drop missions to the bottom."""
pool = getattr(self, pool_name)
with self.lock:
for mission in missions:
pool.move_to_end(mission.url)
mission_ch.pub("MISSION_LIST_REARRANGED", pool)
self.edit = True