From c978e9edf462d6aafd71acb29f714c8a677c2fb5 Mon Sep 17 00:00:00 2001 From: I-Al-Istannen Date: Wed, 30 Dec 2020 14:45:46 +0100 Subject: [PATCH] Resolve a few pylint warnings --- PFERD/authenticators.py | 2 +- PFERD/ilias/crawler.py | 7 +++++-- PFERD/logging.py | 5 +---- PFERD/organizer.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PFERD/authenticators.py b/PFERD/authenticators.py index 5537cc1..f85c9d3 100644 --- a/PFERD/authenticators.py +++ b/PFERD/authenticators.py @@ -14,7 +14,7 @@ PRETTY = PrettyLogger(LOGGER) try: import keyring except ImportError: - PRETTY.warning("Keyring module not found, KeyringAuthenticator won't work!") + pass class TfaAuthenticator: diff --git a/PFERD/ilias/crawler.py b/PFERD/ilias/crawler.py index 4d59dbf..86bf045 100644 --- a/PFERD/ilias/crawler.py +++ b/PFERD/ilias/crawler.py @@ -282,9 +282,12 @@ class IliasCrawler: continue rest_of_name = meeting_name.removeprefix(date_portion_str) - new_name = datetime.datetime.strftime(date_portion, "%Y-%m-%d, %H:%M") + rest_of_name + new_name = datetime.datetime.strftime(date_portion, "%Y-%m-%d, %H:%M") \ + + rest_of_name new_path = Path(folder_path, _sanitize_path_name(new_name)) - result += [IliasCrawlerEntry(new_path, abs_url, IliasElementType.REGULAR_FOLDER, None)] + result += [ + IliasCrawlerEntry(new_path, abs_url, IliasElementType.REGULAR_FOLDER, None) + ] elif element_type is not None: result += [IliasCrawlerEntry(element_path, abs_url, element_type, None)] else: diff --git a/PFERD/logging.py b/PFERD/logging.py index 76741f7..c25019e 100644 --- a/PFERD/logging.py +++ b/PFERD/logging.py @@ -3,13 +3,10 @@ Contains a few logger utility functions and implementations. """ import logging -from pathlib import Path -from typing import List, Optional +from typing import Optional -from rich import print as rich_print from rich._log_render import LogRender from rich.console import Console -from rich.panel import Panel from rich.style import Style from rich.text import Text from rich.theme import Theme diff --git a/PFERD/organizer.py b/PFERD/organizer.py index a15e751..fe5052b 100644 --- a/PFERD/organizer.py +++ b/PFERD/organizer.py @@ -116,7 +116,7 @@ class Organizer(Location): if self._is_marked(dst): PRETTY.warning(f"File {str(dst_absolute)!r} was already written!") conflict = ConflictType.MARKED_FILE_OVERWRITTEN - if self._resolve_conflict(f"Overwrite file?", dst_absolute, conflict, default=False): + if self._resolve_conflict("Overwrite file?", dst_absolute, conflict, default=False): PRETTY.ignored_file(dst_absolute, "file was written previously") return None