From f6af3311da4371998cdb18b9aefe0b082001d673 Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Tue, 13 Oct 2020 20:05:11 +0530 Subject: [PATCH] better method for getting documents folder --- fishy/helper/helper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fishy/helper/helper.py b/fishy/helper/helper.py index df70fc3..d343028 100644 --- a/fishy/helper/helper.py +++ b/fishy/helper/helper.py @@ -136,8 +136,10 @@ def check_addon(name): Extracts the addon from zip and installs it into the AddOn folder of eso """ try: - user = os.path.expanduser("~") - addon_dir = os.path.join(user, "Documents", "Elder Scrolls Online", "live", "Addons") + # noinspection PyUnresolvedReferences + from win32com.shell import shell, shellcon + documents = shell.SHGetFolderPath(0, shellcon.CSIDL_PERSONAL, None, 0) + addon_dir = os.path.join(documents, "Elder Scrolls Online", "live", "Addons") if not os.path.exists(os.path.join(addon_dir, name)): logging.info(f"{name} Addon not found, installing it...") with ZipFile(manifest_file(f"{name}.zip"), 'r') as z: