Skip to content

Commit

Permalink
BUGFIX: Use a more descriptive tcal_available variable name, and inve…
Browse files Browse the repository at this point in the history
…rt the logic
  • Loading branch information
amilcarlucas committed Jul 12, 2024
1 parent 92a21ec commit 5b905a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions MethodicConfigurator/backend_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def __read_last_uploaded_filename(self) -> str:
logging_error("Error reading last uploaded filename: %s", e)
return ""

def get_start_file(self, explicit_index: int, tcal_enabled: bool) -> str:
def get_start_file(self, explicit_index: int, tcal_available: bool) -> str:
# Get the list of intermediate parameter files files that will be processed sequentially
files = list(self.file_parameters.keys())

Expand All @@ -479,15 +479,15 @@ def get_start_file(self, explicit_index: int, tcal_enabled: bool) -> str:
if last_uploaded_filename:
logging_info("Last uploaded file was %s.", last_uploaded_filename)
else:
if tcal_enabled:
if not tcal_available:
logging_info("No last uploaded file found. Starting with the first non-tcal file.")
return files[2]
logging_info("No last uploaded file found. Starting with the first file.")
return files[0]

if last_uploaded_filename not in files:
# Handle the case where last_uploaded_filename is not found in the list
if tcal_enabled:
if not tcal_available:
logging_info("Last uploaded file not found in the list of files. Starting with the first non-tcal file.")
return files[2]
logging_warning("Last uploaded file not found in the list of files. Starting with the first file.")
Expand Down

0 comments on commit 5b905a6

Please sign in to comment.