MCPcopy Create free account
hub / github.com/chubin/cheat.sh / __init__

Method __init__

lib/routing.py:34–61  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32 """
33
34 def __init__(self):
35
36 self._cached_topics_list = []
37 self._cached_topic_type = {}
38
39 adapter_class = adapter.all_adapters(as_dict=True)
40
41 active_adapters = set(CONFIG["adapters.active"] + CONFIG["adapters.mandatory"])
42
43 self._adapter = {
44 "internal": adapter.internal.InternalPages(
45 get_topic_type=self.get_topic_type, get_topics_list=self.get_topics_list
46 ),
47 "unknown": adapter.internal.UnknownPages(
48 get_topic_type=self.get_topic_type, get_topics_list=self.get_topics_list
49 ),
50 }
51
52 for by_name in active_adapters:
53 if by_name not in self._adapter:
54 self._adapter[by_name] = adapter_class[by_name]()
55
56 self._topic_list = {key: obj.get_list() for key, obj in self._adapter.items()}
57
58 self.routing_table = CONFIG["routing.main"]
59 self.routing_table = (
60 CONFIG["routing.pre"] + self.routing_table + CONFIG["routing.post"]
61 )
62
63 def get_topics_list(self, skip_dirs=False, skip_internal=False):
64 """

Callers

nothing calls this directly

Calls 1

get_listMethod · 0.45

Tested by

no test coverage detected