fix: added 'deter' function
This commit is contained in:
@@ -56,9 +56,15 @@ class ActionFlow:
|
|||||||
assert index is not None, "Action '%s' is not registered" % name
|
assert index is not None, "Action '%s' is not registered" % name
|
||||||
return index
|
return index
|
||||||
|
|
||||||
def allow(self, action: type[Action], value=True):
|
def allow(self, *actions: type[Action]):
|
||||||
index = self.index(action)
|
for Item in actions:
|
||||||
self.on[index] = False if value else None
|
index = self.index(Item)
|
||||||
|
self.on[index] = False
|
||||||
|
|
||||||
|
def deter(self, *actions: type[Action]):
|
||||||
|
for Item in actions:
|
||||||
|
index = self.index(Item)
|
||||||
|
self.on[index] = None
|
||||||
|
|
||||||
def stage(self, *preset: type[Action]):
|
def stage(self, *preset: type[Action]):
|
||||||
for Props in preset:
|
for Props in preset:
|
||||||
|
|||||||
Reference in New Issue
Block a user