From 72c911cf690991010096e3b307677f2f9de1e998 Mon Sep 17 00:00:00 2001 From: m-jishnu Date: Fri, 28 Jul 2023 13:38:21 +0530 Subject: [PATCH] minor cleanup --- app/core.py | 2 +- app/modules/url_gen.py | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/core.py b/app/core.py index d4744d2..245a3b9 100644 --- a/app/core.py +++ b/app/core.py @@ -14,7 +14,7 @@ from utls import Worker script_dir = os.path.dirname(os.path.abspath(__file__)) -clr.AddReference(script_dir + r"\data\System.Management.Automation.dll") +clr.AddReference(fr"{script_dir}\data\System.Management.Automation.dll") class internal_func(Ui_MainProgram): diff --git a/app/modules/url_gen.py b/app/modules/url_gen.py index bead47b..757b20b 100644 --- a/app/modules/url_gen.py +++ b/app/modules/url_gen.py @@ -218,8 +218,7 @@ def greater_ver(arg1, arg2): release_type = "Retail" # getting the encrypted cookie for the fe3 delivery api - GetCookie_path = os.path.join(parent_dir, r"data\xml\GetCookie.xml") - with open(GetCookie_path, "r") as f: + with open(fr"{parent_dir}\data\xml\GetCookie.xml", "r") as f: cookie_content = f.read() check(Event) out = session.post( @@ -237,9 +236,7 @@ def greater_ver(arg1, arg2): # getting the update id,revision number and package name from the fe3 delivery api by providing the encrpyted cookie, cat_id, realse type # Map {"retail": "Retail", "release preview": "RP","insider slow": "WIS", "insider fast": "WIF"} - WUIDRequest_path = os.path.join( - parent_dir, r"data\xml\WUIDRequest.xml") - with open(WUIDRequest_path, "r") as f: + with open(fr"{parent_dir}\data\xml\WUIDRequest.xml", "r") as f: cat_id_content = f.read().format(cookie, cat_id, release_type) check(Event) out = session.post( @@ -287,8 +284,7 @@ def greater_ver(arg1, arg2): final_dict[value] = identities[value] # getting the download url for the files using the api - FE3FileUrl_path = os.path.join(parent_dir, r"data\xml\FE3FileUrl.xml") - with open(FE3FileUrl_path, "r") as f: + with open(fr"{parent_dir}\data\xml\FE3FileUrl.xml", "r") as f: file_content = f.read() file_dict = {} # the final result