From 25eff05f48f64af39a4f7cca0fae2a416de6693c Mon Sep 17 00:00:00 2001 From: Zvonimir Sabljic Date: Wed, 16 Aug 2023 13:54:41 +0200 Subject: [PATCH] Two fixes --- euclid/helpers/Project.py | 6 +++++- euclid/helpers/cli.py | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/euclid/helpers/Project.py b/euclid/helpers/Project.py index e9d1c13..8adf4b2 100644 --- a/euclid/helpers/Project.py +++ b/euclid/helpers/Project.py @@ -122,7 +122,11 @@ class Project: .execute()) def get_full_file_path(self, file_path, file_name): - file_path = file_path.replace('./', '', 1).rsplit(file_name, 1)[0] + file_path = file_path.replace('./', '', 1) + if ' ' in file_name or '.' not in file_name: + file_name = '' + else: + file_path = file_path.rsplit(file_name, 1)[0] if file_path.endswith('/'): file_path = file_path.rstrip('/') diff --git a/euclid/helpers/cli.py b/euclid/helpers/cli.py index 5907486..c87f80c 100644 --- a/euclid/helpers/cli.py +++ b/euclid/helpers/cli.py @@ -77,7 +77,9 @@ def execute_command(project, command, timeout=None, force=False): try: while True and return_value is None: elapsed_time = time.time() - start_time - print(colored(f'\rt: {round(elapsed_time * 1000)}ms : ', 'white', attrs=['bold']), end='', flush=True) + if timeout is not None: + print(colored(f'\rt: {round(elapsed_time * 1000)}ms : ', 'white', attrs=['bold']), end='', flush=True) + # Check if process has finished if process.poll() is not None: # Get remaining lines from the queue