From 25622972f1da081431008f92a72c1011557ff250 Mon Sep 17 00:00:00 2001 From: Bruce Wen Date: Wed, 15 Nov 2023 09:05:20 +0100 Subject: [PATCH] Fix code issue in running shell command --- eutmux.py | 8 -------- utils.py | 11 ----------- 2 files changed, 19 deletions(-) diff --git a/eutmux.py b/eutmux.py index 1498c82..9af9fa1 100644 --- a/eutmux.py +++ b/eutmux.py @@ -520,14 +520,6 @@ def init(config_file="eutmux.yaml"): theme_filename = f"{eutmux_config_home}/{theme_filename}" else: theme_filename = "eutmux.theme.yaml" -<<<<<<< HEAD -<<<<<<< HEAD - -======= ->>>>>>> 9e9ce1d (Fix code issue in running shell command) -======= - print(theme_filename) ->>>>>>> fa2ca52 (temp) with open(theme_filename, "r", encoding=UTF_8) as theme_file: theme_config = yaml.safe_load(theme_file) theme = Theme(theme_config) diff --git a/utils.py b/utils.py index ec30024..08f5d79 100644 --- a/utils.py +++ b/utils.py @@ -22,16 +22,6 @@ def get_tmux_option(name, default_value): def run_shell_command(command, default_output=None): """Run shell command.""" command_args = shlex.split(command) -<<<<<<< HEAD - result = ( - subprocess.Popen(command_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - ) - print(result.returncode) - if result.returncode != 0: - return default_output - else: - return result.stdout.strip() -======= with ( subprocess.Popen(command_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ) as process: @@ -48,4 +38,3 @@ def run_shell_command(command, default_output=None): if __name__ == "__main__": value = get_tmux_option("@eutmux_base_color_total", 5) print(value) ->>>>>>> 9e9ce1d (Fix code issue in running shell command)