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

Commit

Permalink
feat(plugin): add pause_before_continue_race plugin
Browse files Browse the repository at this point in the history
close #170
  • Loading branch information
NateScarlet committed Aug 28, 2021
1 parent 2fd9ed4 commit 6696c67
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plugins/pause_before_continue_race.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from auto_derby.single_mode.commands.race import RaceResult
from auto_derby.single_mode.context import Context
import auto_derby
from auto_derby import terminal


class Plugin(auto_derby.Plugin):
def install(self) -> None:
_next = auto_derby.config.on_single_mode_race_result

def _handle(ctx: Context, result: RaceResult):
if result.is_failed:
terminal.pause(f"pause before continue race: {result}")
_next(ctx, result)

auto_derby.config.on_single_mode_race_result = _handle


auto_derby.plugin.register(__name__, Plugin())

0 comments on commit 6696c67

Please sign in to comment.