Make dependencies() a @staticmethod instead of a @property

This commit is contained in:
Christophe Bedard 2019-08-02 15:29:55 +02:00
parent 5341a066b6
commit 1fa5b50f97
2 changed files with 8 additions and 2 deletions

View file

@ -106,8 +106,8 @@ class EventHandler():
"""Get the handler functions map.""" """Get the handler functions map."""
return self._handler_map return self._handler_map
@property @staticmethod
def dependencies(self) -> List[Type['EventHandler']]: def dependencies() -> List[Type['EventHandler']]:
""" """
Get the `EventHandler`s that should also exist along with this current one. Get the `EventHandler`s that should also exist along with this current one.

View file

@ -18,12 +18,14 @@ from collections import defaultdict
from typing import Dict from typing import Dict
from typing import List from typing import List
from typing import Tuple from typing import Tuple
from typing import Type
from typing import Union from typing import Union
from tracetools_read.utils import get_field from tracetools_read.utils import get_field
from . import EventHandler from . import EventHandler
from . import EventMetadata from . import EventMetadata
from .cpu_time import CpuTimeHandler
from ..data_model.profile import ProfileDataModel from ..data_model.profile import ProfileDataModel
@ -79,6 +81,10 @@ class ProfileHandler(EventHandler):
int('0x7F6CD678D0F8', 16): 'collect_entities', int('0x7F6CD678D0F8', 16): 'collect_entities',
} }
@staticmethod
def dependencies() -> List[Type[EventHandler]]:
return [CpuTimeHandler]
def get_data_model(self) -> ProfileDataModel: def get_data_model(self) -> ProfileDataModel:
return self._data return self._data