MCPcopy
hub / github.com/programthink/zhao / init

Method init

bin/make.py:28–41  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

26
27 @classmethod
28 def init(cls) :
29 Node.all = {}
30 Node.keys = []
31
32 for node_type in [u'person', u'company'] :
33 for node_id in os.listdir(u'../data/' + node_type) :
34 yaml_file = u'../data/%s/%s/brief.yaml' % (node_type, node_id)
35 node = Node(_load_yaml(yaml_file), node_id, node_type)
36 if node_id in Node.all :
37 _raise_err(u'Node id conflict: "%s"!', node_id)
38
39 Node.all[node_id] = node
40 Node.keys.append(node_id)
41 print(u'Node number: %d' % len(Node.all))
42
43
44 def __init__(self, yaml, node_id, type) :

Callers 1

__init__Method · 0.45

Calls 3

NodeClass · 0.85
_load_yamlFunction · 0.85
_raise_errFunction · 0.85

Tested by

no test coverage detected