From 638db2dbf65cde40c8b6756e6f69e5a698eb0477 Mon Sep 17 00:00:00 2001 From: Nek-12 Date: Thu, 16 Jul 2020 20:49:15 +0300 Subject: [PATCH] cleaned up the code --- cleaner.py | 4 ++-- customiser.py | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cleaner.py b/cleaner.py index 5214649..dfc6479 100644 --- a/cleaner.py +++ b/cleaner.py @@ -56,8 +56,8 @@ try: f' * {os.path.join(filepath, "app.asar.bak")} was not found: step skipped.') if sys.platform == 'linux' and 'microsoft' not in platform.uname()[3].lower(): - pathlist = ['/usr/bin/notion-app', '/usr/bin/notion', '/opt/notion-app/notion-app'] - # get all the possible paths where the launcher may be located + pathlist = ('/usr/bin/notion-app', '/usr/bin/notion', '/opt/notion-app/notion-app') + # check all the possible paths where the launcher may be located for path in pathlist: if os.path.exists(path): with open(path, 'r', encoding='UTF-8') as launcher: diff --git a/customiser.py b/customiser.py index 7002487..88c4ba3 100755 --- a/customiser.py +++ b/customiser.py @@ -224,15 +224,12 @@ try: f' * {os.path.join(filepath, "app", "main", "main.js")} was not found: step skipped.') if sys.platform == 'linux' and 'microsoft' not in platform.uname()[3].lower(): - def patch(dest): - print(f' ...patching app launcher in {path}') - subprocess.call(['sed', '-i', r's/electron6\ app\.asar/electron6\ app/', dest]) - - pathlist = ['/usr/bin/notion-app', '/usr/bin/notion', '/opt/notion-app/notion-app'] + pathlist = ('/usr/bin/notion-app', '/usr/bin/notion', '/opt/notion-app/notion-app') # check all the paths where the launcher may be located for path in pathlist: if os.path.exists(path): - patch(path) + print(f' ...patching app launcher in {path}') + subprocess.call(['sed', '-i', r's/electron6\ app\.asar/electron6\ app/', path]) print('\n>>> SUCCESSFULLY CUSTOMISED <<<')