Skip to content

Commit

Permalink
Fix interactive messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
riga committed Mar 28, 2023
1 parent aaaa6f6 commit cf1dfa3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion law/target/remote/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ def _lock(self, cpath, **kwargs):
with open(lock_path, "w") as f:
f.write("")
self._locked_cpaths.add(cpath)
os.utime(lock_path, None)
try:
os.utime(lock_path, None)
except OSError:
pass

yield
except:
Expand Down
4 changes: 2 additions & 2 deletions law/task/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def _query_choice(*args, **kwargs):
if not mode:
mode = _query_choice("removal mode?", modes, default="i", descriptions=mode_names)
mode_name = mode_names[modes.index(mode)]
print("selected {} mode".format(colored(mode_name + " mode", "blue", style="bright")))
print("selected {} mode".format(colored(mode_name, "blue", style="bright")))
print("")

done = []
Expand Down Expand Up @@ -479,7 +479,7 @@ def _query_choice(*args, **kwargs):
if mode not in modes:
raise Exception("unknown fetch mode '{}'".format(mode))
mode_name = mode_names[modes.index(mode)]
print("selected {} mode".format(colored(mode_name + " mode", "blue", style="bright")))
print("selected {} mode".format(colored(mode_name, "blue", style="bright")))
print("")

done = []
Expand Down
2 changes: 1 addition & 1 deletion law/workflow/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ def poll(self):
data[field] = value

# when the task picked up an existing submission file, then in the first polling
# iteration, it might happen that a job is finished, but outputs of its tasks are
# iteration it might happen that a job is finished, but outputs of its tasks are
# not existing, e.g. when they were removed externaly and the job id is still known
# to the batch system; in this case, mark it as unknown and to be retried
if self._submitted and i == 0:
Expand Down

0 comments on commit cf1dfa3

Please sign in to comment.