Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

Commit

Permalink
Hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
ysfchn committed Jun 22, 2021
1 parent 979dfd9 commit c106c5a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 3 additions & 1 deletion pyconduit/conduit.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,10 @@ async def run(self) -> None:
# If one of previous steps has failed don't execute the next ones.
if self.success == None or item.forced:
try:
if item.status != ConduitStatus.DONE:
if item.status not in [ConduitStatus.DONE, ConduitStatus.NONE]:
raise ConduitError(item.status, item)
elif not item.check_if_condition():
raise ConduitBlock(ConduitStatus.IF_CONDITION_FAILED, item)
else:
process.set_function(item.function())
if item.block.is_coroutine:
Expand Down
10 changes: 4 additions & 6 deletions pyconduit/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ def __init__(
self.forced : bool = forced
self.block : Union[ConduitBlock, ConduitBlock._Partial] = block
self.status : ConduitStatus = ConduitStatus.NONE
self.refresh_status()
self.return_value : Any = None
self.parameters : Dict[str, Any] = parameters
self.if_condition : Union[str, List[str], None] = if_condition
self.refresh_status()
self.job.steps.append(self)


Expand All @@ -137,13 +137,11 @@ def refresh_status(self) -> None:
self.status = ConduitStatus.BLOCK_NOT_FOUND
elif self.is_id_duplicate:
self.status = ConduitStatus.DUPLICATE_STEP_IDS
elif not self.block.exists_tags(self.tags):
elif not self.block.exists_tags(self.job.tags):
self.status = ConduitStatus.FORBIDDEN_BLOCK
elif self._get_block_limit(self.block)[0]:
elif self.job._get_block_limit(self.block)[0]:
self.status = ConduitStatus.BLOCK_LIMIT_EXCEED
elif not self.check_if_condition():
self.status = ConduitStatus.IF_CONDITION_FAILED
elif self.step_limit != None and len(self.steps) > self.step_limit:
elif self.job.step_limit != None and len(self.job.steps) > self.job.step_limit:
self.status = ConduitStatus.STEP_LIMIT_EXCEED
else:
self.status = ConduitStatus.NONE
Expand Down
2 changes: 1 addition & 1 deletion pyconduit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def parse_slice(value : str) -> Optional[slice]:
try:
if value:
return slice(*[int(p) if p else None for p in value.split(":")])
except TypeError:
except (TypeError, ValueError):
return None


Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = pyconduit
version = 1.0.0
version = 1.0.1
author = ysfchn
description = A simple workflow manager that can execute developer-defined methods from user-defined workflow files.
license = MIT
Expand Down

0 comments on commit c106c5a

Please sign in to comment.