1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 02:41:11 +01:00

fw/signal: use enum to define priorities

Use an enum rather than a random class to define the priority levels
for the signals.
This commit is contained in:
Sergei Trofimov 2018-05-30 11:21:01 +01:00 committed by Marc Bonnici
parent e015f438ae
commit d79e8324f0

View File

@ -26,7 +26,7 @@ from contextlib import contextmanager
import wrapt
from louie import dispatcher
from wa.utils.types import prioritylist
from wa.utils.types import prioritylist, enum
logger = logging.getLogger('signal')
@ -193,18 +193,10 @@ AFTER_OVERALL_RESULTS_PROCESSING = Signal(
'after-overall-results-process')
class CallbackPriority(object):
EXTREMELY_HIGH = 30
VERY_HIGH = 20
HIGH = 10
NORMAL = 0
LOW = -10
VERY_LOW = -20
EXTREMELY_LOW = -30
def __init__(self):
raise ValueError('Cannot instantiate')
CallbackPriority = enum(['extremely_low', 'very_low', 'low', 'normal',
'high', 'very_high', 'extremely_high'], -30, 10)
class _prioritylist_wrapper(prioritylist):