Skip to content

Commit 2a6c2d1

Browse files
committed
Import EventType separately in uses of FileWatcher
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 05bb092 commit 2a6c2d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/frequenz/sdk/actor/_config_managing.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import Any, assert_never
1111

1212
from frequenz.channels import Sender
13-
from frequenz.channels.file_watcher import FileWatcher
13+
from frequenz.channels.file_watcher import EventType, FileWatcher
1414

1515
from ..actor._actor import Actor
1616
from ..config import Config
@@ -34,7 +34,7 @@ def __init__(
3434
self,
3535
config_path: pathlib.Path | str,
3636
output: Sender[Config],
37-
event_types: abc.Set[FileWatcher.EventType] = frozenset(FileWatcher.EventType),
37+
event_types: abc.Set[EventType] = frozenset(EventType),
3838
*,
3939
name: str | None = None,
4040
) -> None:
@@ -99,21 +99,21 @@ async def _run(self) -> None:
9999
continue
100100

101101
match event.type:
102-
case FileWatcher.EventType.CREATE:
102+
case EventType.CREATE:
103103
_logger.info(
104104
"%s: The configuration file %s was created, sending new config...",
105105
self,
106106
self._config_path,
107107
)
108108
await self.send_config()
109-
case FileWatcher.EventType.MODIFY:
109+
case EventType.MODIFY:
110110
_logger.info(
111111
"%s: The configuration file %s was modified, sending update...",
112112
self,
113113
self._config_path,
114114
)
115115
await self.send_config()
116-
case FileWatcher.EventType.DELETE:
116+
case EventType.DELETE:
117117
_logger.info(
118118
"%s: The configuration file %s was deleted, ignoring...",
119119
self,

0 commit comments

Comments
 (0)