Skip to content

Commit af8c9c2

Browse files
committed
Add Priority and Action enums
1 parent 721b260 commit af8c9c2

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

cloudbot/hook.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
import inspect
22
import re
33
import collections
4+
from enum import Enum, unique
45

56
from cloudbot.event import EventType
67

78
valid_command_re = re.compile(r"^\w+$")
89

910

11+
@unique
12+
class Priority(Enum):
13+
LOWEST = -128
14+
LOW = -64
15+
NORMAL = 0
16+
HIGH = 63
17+
HIGHEST = 127
18+
19+
20+
@unique
21+
class Action(Enum):
22+
"""Defines the action to take after executing a hook"""
23+
HALTTYPE = 0 # Once this hook executes, no other hook of that type should run
24+
HALTALL = 1 # Once this hook executes, No other hook should run
25+
CONTINUE = 2 # Normal execution of all hooks
26+
27+
1028
class _Hook:
1129
"""
1230
:type function: function

0 commit comments

Comments
 (0)