-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a registry abc instead of concrete class
- Loading branch information
Showing
4 changed files
with
37 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
from galaxy.tours.schema import ( | ||
TourDetails, | ||
TourList, | ||
) | ||
|
||
|
||
class ToursRegistry(ABC): | ||
|
||
@abstractmethod | ||
def tours_by_id_with_description(self) -> TourList: | ||
"""Return list of tours.""" | ||
|
||
@abstractmethod | ||
def tour_contents(self, tour_id: str) -> TourDetails: | ||
"""Return tour details.""" | ||
|
||
@abstractmethod | ||
def load_tour(self, tour_id: str) -> TourDetails: | ||
"""Reload tour and return tour details.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters