From ecab1be70e9fd6ef5cae301ff71968e0bed4c27f Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 12 Sep 2022 13:35:47 -0400 Subject: [PATCH] Island: Change IslandEventTopic definition from dynamic to static My code completion tool doesn't play well with dynamically defined Enums. --- .../cc/event_queue/i_island_event_queue.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/event_queue/i_island_event_queue.py b/monkey/monkey_island/cc/event_queue/i_island_event_queue.py index cfee63461..d2398df86 100644 --- a/monkey/monkey_island/cc/event_queue/i_island_event_queue.py +++ b/monkey/monkey_island/cc/event_queue/i_island_event_queue.py @@ -1,12 +1,14 @@ from abc import ABC, abstractmethod -from enum import Enum +from enum import Enum, auto from typing import Any from . import IslandEventSubscriber -IslandEventTopic = Enum( - "IslandEventTopic", ["AGENT_CONNECTED", "CLEAR_SIMULATION_DATA", "RESET_AGENT_CONFIGURATION"] -) + +class IslandEventTopic(Enum): + AGENT_CONNECTED = auto() + CLEAR_SIMULATION_DATA = auto() + RESET_AGENT_CONFIGURATION = auto() class IIslandEventQueue(ABC):