How to use the comiccrawler.profile.get function in comiccrawler

To help you get started, we’ve selected a few comiccrawler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eight04 / ComicCrawler / comiccrawler / mission_manager.py View on Github external
def load(self):
		"""Load mission from json.

		If failing to load missions, create json backup .
		"""
		try:
			self._load()
		except Exception:
			print("Failed to load session!")
			backup(profile("*.json"))
			raise
		self.cleanup()
github eight04 / ComicCrawler / comiccrawler / download_manager.py View on Github external
def do_download():
				debug_log("do_download")
				with load_episodes(mission):
					download(mission, profile(mission.module.config["savepath"]))
github eight04 / ComicCrawler / comiccrawler / mission_manager.py View on Github external
def _load(self):
		"""Load missions from json. Called by MissionManager.load."""
		pool = json_load(profile("pool.json")) or []
		view = json_load(profile("view.json")) or []
		library = json_load(profile("library.json")) or []

		for m_data in pool:
			# reset state
			if m_data["state"] in ("DOWNLOADING", "ANALYZING"):
				m_data["state"] = "ERROR"
			# build episodes
			# compatible 2016.6.4
			if m_data["episodes"]:
				episodes = []
				for ep_data in m_data["episodes"]:
					# compatible 2016.4.3
					if "total" not in ep_data:
						if not ep_data["current_url"]:
							ep_data["total"] = 0
github eight04 / ComicCrawler / comiccrawler / mission_manager.py View on Github external
def _load(self):
		"""Load missions from json. Called by MissionManager.load."""
		pool = json_load(profile("pool.json")) or []
		view = json_load(profile("view.json")) or []
		library = json_load(profile("library.json")) or []

		for m_data in pool:
			# reset state
			if m_data["state"] in ("DOWNLOADING", "ANALYZING"):
				m_data["state"] = "ERROR"
			# build episodes
			# compatible 2016.6.4
			if m_data["episodes"]:
				episodes = []
				for ep_data in m_data["episodes"]:
					# compatible 2016.4.3
					if "total" not in ep_data:
						if not ep_data["current_url"]:
							ep_data["total"] = 0
							
						elif ep_data["url"] == ep_data["current_url"]:
github eight04 / ComicCrawler / comiccrawler / gui.py View on Github external
def tvOpen():
				for mission in table.selected():
					savepath = profile(mission.module.config["savepath"])
					folder = os.path.join(savepath, safefilepath(mission.title))
					folder = os.path.expanduser(folder)
					if not os.path.isdir(folder):
						os.makedirs(folder)
					desktop.open(folder)
github eight04 / ComicCrawler / comiccrawler / mission_manager.py View on Github external
def save(self):
		"""Save missions to json."""
		if not self.edit:
			return

		with mission_lock:
			json_dump(list(self.pool.values()), profile("pool.json"))
			json_dump(list(self.view), profile("view.json"))
			json_dump(list(self.library), profile("library.json"))
			
		self.edit = False
		print("Session saved")
github eight04 / ComicCrawler / comiccrawler / grabber.py View on Github external
def grabber_log(*args):
	if setting.getboolean("errorlog"):
		content = time.strftime("%Y-%m-%dT%H:%M:%S%z") + "\n" + pformat(args) + "\n\n"
		content_write(profile("grabber.log"), content, append=True)
github eight04 / ComicCrawler / comiccrawler / episode_loader.py View on Github external
def make_ep_path(id):
	"""Construct ep path with id"""
	return profile_get("pool/" + safefilepath(id + ".json"))