black shift
This commit is contained in:
@@ -11,7 +11,7 @@ from config import api_config
|
||||
|
||||
|
||||
def create_events_if_any_cluster_set():
|
||||
from events import retrieve_all_clusters
|
||||
from events import retrieve_all_clusters
|
||||
|
||||
for event_cluster in retrieve_all_clusters():
|
||||
for event in event_cluster.retrieve_all_event_clusters:
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
from .template.cluster import (
|
||||
TemplateEventClusterSet
|
||||
)
|
||||
from .template.cluster import TemplateEventClusterSet
|
||||
|
||||
__all__ = [
|
||||
"TemplateEventClusterSet",
|
||||
]
|
||||
|
||||
|
||||
def retrieve_all_clusters():
|
||||
return [TemplateEventClusterSet]
|
||||
return [TemplateEventClusterSet]
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
from ApiServices.TemplateService.initializer.event_clusters import EventCluster, SetEventCluster
|
||||
from ApiServices.TemplateService.initializer.event_clusters import (
|
||||
EventCluster,
|
||||
SetEventCluster,
|
||||
)
|
||||
|
||||
|
||||
TemplateEventCluster = EventCluster(
|
||||
@@ -12,4 +15,3 @@ OtherTemplateEventCluster = EventCluster(
|
||||
TemplateEventClusterSet = SetEventCluster()
|
||||
TemplateEventClusterSet.add_event_cluster(TemplateEventCluster)
|
||||
TemplateEventClusterSet.add_event_cluster(OtherTemplateEventCluster)
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ class EventCluster:
|
||||
"""
|
||||
EventCluster
|
||||
"""
|
||||
|
||||
def __init__(self, endpoint_uu_id: str):
|
||||
self.endpoint_uu_id = endpoint_uu_id
|
||||
self.events = []
|
||||
@@ -96,13 +97,17 @@ class SetEventCluster:
|
||||
"""
|
||||
SetEventCluster
|
||||
"""
|
||||
|
||||
list_of_event_clusters: list[EventCluster] = []
|
||||
|
||||
def add_event_cluster(self, event_cluster: EventCluster):
|
||||
"""
|
||||
Add an event cluster to the set
|
||||
"""
|
||||
endpoint_uu_id_list = [event_cluster_uuid.endpoint_uu_id for event_cluster_uuid in self.list_of_event_clusters]
|
||||
endpoint_uu_id_list = [
|
||||
event_cluster_uuid.endpoint_uu_id
|
||||
for event_cluster_uuid in self.list_of_event_clusters
|
||||
]
|
||||
if event_cluster.endpoint_uu_id not in endpoint_uu_id_list:
|
||||
self.list_of_event_clusters.append(event_cluster)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user