Use PrettyLogger warning everywhere

This commit is contained in:
I-Al-Istannen 2020-05-10 21:53:24 +02:00
parent e7b08420ba
commit a0f9d31d94
2 changed files with 6 additions and 6 deletions

View File

@ -163,7 +163,7 @@ class IliasCrawler:
)
if modification_date_match is None:
modification_date = None
LOGGER.warning("Could not extract start date from %r", all_properties_text)
PRETTY.warning(f"Could not extract start date from {all_properties_text!r}")
else:
modification_date_str = modification_date_match.group(1)
modification_date = demangle_date(modification_date_str)
@ -203,14 +203,14 @@ class IliasCrawler:
break
if found_parent is None:
LOGGER.warning("Could not find element icon for %r", url)
PRETTY.warning(f"Could not find element icon for {url!r}")
return []
# Find the small descriptive icon to figure out the type
img_tag: Optional[bs4.Tag] = found_parent.select_one("img.ilListItemIcon")
if img_tag is None:
LOGGER.warning("Could not find image tag for %r", url)
PRETTY.warning(f"Could not find image tag for {url!r}")
return []
# A forum
@ -319,7 +319,7 @@ class IliasCrawler:
json_match = regex.search(str(video_page_soup))
if json_match is None:
LOGGER.warning("Could not find json stream info for %r", video_page_url)
PRETTY.warning(f"Could not find json stream info for {video_page_url!r}")
return []
json_str = json_match.group(1)

View File

@ -46,7 +46,7 @@ class Organizer(Location):
LOGGER.debug("Copying %s to %s", src_absolute, dst_absolute)
if self._is_marked(dst):
LOGGER.warning("File %r was already written!", str(dst_absolute))
PRETTY.warning(f"File {str(dst_absolute)!r} was already written!")
if not prompt_yes_no(f"Overwrite file?", default=False):
PRETTY.ignored_file(dst_absolute, "file was written previously")
return
@ -56,7 +56,7 @@ class Organizer(Location):
if prompt_yes_no(f"Overwrite folder {dst_absolute} with file?", default=False):
shutil.rmtree(dst_absolute)
else:
LOGGER.warning("Could not add file %s", dst_absolute)
PRETTY.warning(f"Could not add file {str(dst_absolute)!r}")
return
# Destination file exists