Skip to content

Commit 9d6a4dd

Browse files
committed
Use ABC for Updater base type
1 parent 3c2fe79 commit 9d6a4dd

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

flatpak_indexer/datasource/__init__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1+
from abc import ABC, abstractmethod
12
from typing import Dict, List
23

34
from ..config import Config
45
from ..models import RegistryModel
56

67

7-
class Updater:
8-
def __init__(self, config: Config):
9-
raise NotImplementedError()
8+
class Updater(ABC):
9+
@abstractmethod
10+
def __init__(self, config: Config): ...
1011

11-
def start(self):
12-
raise NotImplementedError()
12+
@abstractmethod
13+
def start(self) -> None: ...
1314

14-
def update(self, registry_data: Dict[str, RegistryModel]):
15-
raise NotImplementedError()
15+
@abstractmethod
16+
def update(self, registry_data: Dict[str, RegistryModel]) -> None: ...
1617

17-
def stop(self):
18-
raise NotImplementedError()
18+
@abstractmethod
19+
def stop(self) -> None: ...
1920

2021

2122
def load_updaters(config) -> List[Updater]:

0 commit comments

Comments
 (0)