Skip to content

Commit

Permalink
Use logging.warning instead of deprecated warn function
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter committed Jan 19, 2024
1 parent f1035f7 commit 9e8327b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions minigalaxy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get_library(self):
else:
continue
if not product["url"]:
logger.warn("{} ({}) has no store page url".format(product["title"], product['id']))
logger.warning("{} ({}) has no store page url".format(product["title"], product['id']))
game = Game(name=product["title"], url=product["url"], game_id=product["id"],
image_url=product["image"], platform=platform, category=product["category"])
games.append(game)
Expand Down Expand Up @@ -194,10 +194,10 @@ def get_download_file_info(self, url):
logger.error("Couldn't retrieve file info. Encountered HTTP exception: {}", exc_info=1)

if not file_info.md5:
logger.warn("Couldn't find md5 in xml checksum data")
logger.warning("Couldn't find md5 in xml checksum data")

if not file_info.size:
logger.warn("Couldn't find file size in xml checksum data")
logger.warning("Couldn't find file size in xml checksum data")

return file_info

Expand Down
2 changes: 1 addition & 1 deletion minigalaxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __load(self) -> None:
try:
self.__config = json.loads(file.read())
except (json.decoder.JSONDecodeError, UnicodeDecodeError):
logger.warn("Reading config.json failed, creating new config file.")
logger.warning("Reading config.json failed, creating new config file.")
os.remove(self.__config_file)

def __write(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion minigalaxy/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def verify_installer_integrity(game, installer):
error_message = _("{} was corrupted. Please download it again.").format(installer_file_name)
break
else:
logger.warn("Warning. No info about correct %s MD5 checksum", installer_file_name)
logger.warning("Warning. No info about correct %s MD5 checksum", installer_file_name)
return error_message


Expand Down
2 changes: 1 addition & 1 deletion minigalaxy/ui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, config: Config, api: 'Api', download_manager: DownloadManager
logger.debug("Authenticated as: %s", self.api.get_user_info())
self.HeaderBar.set_subtitle(self.api.get_user_info())
except Exception:
logger.warn("Starting in offline mode after receiving exception", exc_info=1)
logger.warning("Starting in offline mode after receiving exception", exc_info=1)
self.offline = True
self.sync_library()

Expand Down

0 comments on commit 9e8327b

Please sign in to comment.