コード例 #1
0
ファイル: services.py プロジェクト: thedrow/jumpstarter
    async def skip_if_started_or_wait_if_starting(self, ctx):
        if self.is_started():
            return Skip()

        if self.is_starting() or self.is_restarting_starting():
            await self._started_event.wait()

            return Skip()

        return Success()
コード例 #2
0
ファイル: methods.py プロジェクト: sashgorokhov-forks/stories
    def two(self, ctx):
        if ctx.foo > 1:
            return Failure()

        if ctx.bar < 0:
            return Skip()

        return Success(baz=4)
コード例 #3
0
    def two(self, ctx):
        if ctx.foo > 2:
            return Failure("'foo' is too big")

        if ctx.foo > 1:
            return Failure()

        if ctx.bar < 0:
            return Skip()

        return Success(baz=4)
コード例 #4
0
 async def before(self, ctx):
     return Skip()
コード例 #5
0
ファイル: test_return.py プロジェクト: thedrow/stories
def test_skip_representation():

    skip = Skip()
    assert repr(skip) == "Skip()"
コード例 #6
0
ファイル: functions.py プロジェクト: magican/stories
 def first(self, ctx):
     return Skip()
コード例 #7
0
ファイル: services.py プロジェクト: thedrow/jumpstarter
 async def skip_if_not_initializing(self, ctx):
     return Success() if self.is_initializing() else Skip()
コード例 #8
0
 def check_that_it_is_my_message(self, ctx):
     if ctx.message["content"] == f"@**{self._bot_name}**":
         return Success()
     else:
         return Skip()