mirror of
https://github.com/chubin/cheat.sh.git
synced 2026-06-20 13:16:44 +02:00
adapter refactoring: separated superclass
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import abc
|
||||
|
||||
class Adapter(object):
|
||||
def __init__(self):
|
||||
self._list = self._get_list()
|
||||
|
||||
@abc.abstractmethod
|
||||
def _get_list(self):
|
||||
return []
|
||||
|
||||
def get_list(self):
|
||||
return self._list
|
||||
|
||||
def is_found(self, topic):
|
||||
return topic in self._list
|
||||
|
||||
@abc.abstractmethod
|
||||
def get_page(self, topic, request_options=None):
|
||||
pass
|
||||
Reference in New Issue
Block a user