Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Remove class
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredoconnell committed Oct 12, 2023
1 parent d953ad9 commit 5e1c28f
Showing 1 changed file with 26 additions and 29 deletions.
55 changes: 26 additions & 29 deletions arcaflow_plugin_wait/arcaflow_plugin_wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,35 @@ class ErrorOutput:
actual_wait_seconds: float


class WaitStep:

@plugin.step(
id="wait",
name="Wait",
description="Waits for the given amount of time",
outputs={
"success": SuccessOutput,
"error": ErrorOutput,
},
@plugin.step(
id="wait",
name="Wait",
description="Waits for the given amount of time",
outputs={
"success": SuccessOutput,
"error": ErrorOutput,
},
)
def wait(
self,
params: InputParams,
) -> typing.Tuple[str, typing.Union[SuccessOutput, ErrorOutput]]:
"""
:param params:
:return: the string identifying which output it is,
as well the output structure
"""
start_time = time.time()
self.exit.wait(params.seconds)
actual_time = time.time() - start_time
return "success", SuccessOutput(
"Waited {:0.2f} seconds after being scheduled to wait for {}"
" seconds.".format(actual_time, params.seconds),
actual_time
)
def wait(
self,
params: InputParams,
) -> typing.Tuple[str, typing.Union[SuccessOutput, ErrorOutput]]:
"""
:param params:
:return: the string identifying which output it is,
as well the output structure
"""
start_time = time.time()
self.exit.wait(params.seconds)
actual_time = time.time() - start_time
return "success", SuccessOutput(
"Waited {:0.2f} seconds after being scheduled to wait for {}"
" seconds.".format(actual_time, params.seconds),
actual_time
)


if __name__ == "__main__":
sys.exit(plugin.run(plugin.build_schema(
WaitStep.wait,
wait,
)))

0 comments on commit 5e1c28f

Please sign in to comment.