MCPcopy Create free account
hub / github.com/SplootCode/splootcode / processEntry

Function processEntry

python/generate_tray.py:91–111  ·  view source on GitHub ↗
(data, builtin_docs, sploot_nodes)

Source from the content-addressed store, hash-verified

89
90
91def processEntry(data, builtin_docs, sploot_nodes):
92 if type(data) == dict and 'category' in data:
93 return processCategory(data, builtin_docs, sploot_nodes)
94
95 if type(data) != str:
96 raise Exception(f'{data} is not a string. If not a category, then all entries should be strings.')
97
98 key = data
99
100 components = key.split('.')
101 if components[0] == 'sploot-node':
102 if components[1] in sploot_nodes:
103 return sploot_nodes[components[1]]
104 elif components[0] == 'builtins':
105 if len(components) == 2:
106 # A builtin value or function
107 return get_entry_for_builtin_value(key, components[1], builtin_docs)
108 elif len(components) == 3:
109 return get_entry_for_builtin_attr(key, components[1], components[2], builtin_docs)
110
111 raise Exception(f'Unsupported entry key: {key}')
112
113
114def generate_sploot_node_docs():

Callers 1

processCategoryFunction · 0.85

Calls 3

processCategoryFunction · 0.85

Tested by

no test coverage detected