From b65e32dbae4b91acbb97a6df1c5eff47f1d8cd6d Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Wed, 22 Jun 2022 10:20:30 +0200 Subject: [PATCH] Update agnostic_paths.py --- modules/agnostic_paths.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/agnostic_paths.py b/modules/agnostic_paths.py index a88554b..5a8f9f2 100644 --- a/modules/agnostic_paths.py +++ b/modules/agnostic_paths.py @@ -11,7 +11,7 @@ class AgnosticPaths: An agnostic path object, containing all methods to access the files and folders in a standard discord install """ - def __init__(self, ptb, forced_path=None): + def __init__(self, ptb, force_path=""): """ :param ptb: Whether the discord is a public beta install (ptb="PTB") or not (ptb="") :type ptb: str @@ -20,6 +20,7 @@ class AgnosticPaths: """ self.ptb = ptb self.os = self.get_os() + self.force_path = force_path[0] self.main_path = self._get_path() self.version = self.get_version() self._update_path() @@ -51,6 +52,8 @@ class AgnosticPaths: :return: Base path of the install (minus the version on windows) :rtype: str """ + if self.force_path != "": + return self.force_path if self.os == 'windows': return os.path.join(os.path.expanduser('~'), "AppData", "Local", f"Discord{self.ptb}") elif self.os == 'linux':