From eee8e83ac8ef29630eef9f7da5c3dc544add9bb1 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Thu, 22 Feb 2024 03:13:29 -0500 Subject: [PATCH] [ADD] script remote git compare: support git cola like git gui --- script/git/remote_code_generation_git_compare.py | 8 ++++++-- script/selenium/web_login.py | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/script/git/remote_code_generation_git_compare.py b/script/git/remote_code_generation_git_compare.py index 2296605..6f4e295 100755 --- a/script/git/remote_code_generation_git_compare.py +++ b/script/git/remote_code_generation_git_compare.py @@ -49,6 +49,9 @@ def get_config(): help="Don't show output of difference.", ) parser.add_argument("--git_gui", action="store_true", help="Open git gui.") + parser.add_argument( + "--git_cola", action="store_true", help="Open git cola." + ) parser.add_argument("--meld", action="store_true", help="Open meld.") parser.add_argument( "--clear", @@ -64,7 +67,7 @@ def main(): # path = tempfile.mkdtemp() path = tempfile.NamedTemporaryFile().name if os.path.exists(config.directory1) and os.path.exists(config.directory2): - if config.git_gui: + if config.git_gui or config.git_cola: shutil.copytree(config.directory1, path) shutil.copy2("./.gitignore", path) # repo = Repo(path) @@ -79,8 +82,9 @@ def main(): if not config.quiet: print(status) + cmd = "git cola" if config.git_cola else "git gui" try: - subprocess.call(f"cd {path};git gui", shell=True) + subprocess.call(f"cd {path};{cmd}", shell=True) except: pass if config.clear: diff --git a/script/selenium/web_login.py b/script/selenium/web_login.py index 287f678..9ee711e 100755 --- a/script/selenium/web_login.py +++ b/script/selenium/web_login.py @@ -131,7 +131,10 @@ def run(config): options=firefox_options, service=firefox_services ) except Exception: - print("Cannot open Firefox profile, so will force firefox snap for Ubuntu users.") + print( + "Cannot open Firefox profile, so will force firefox snap for" + " Ubuntu users." + ) firefox_services = Service( executable_path=getoutput( "find /snap/firefox -name geckodriver"