MCPcopy Create free account
hub / github.com/Inori/GPCS4 / ParseImportFile

Function ParseImportFile

Tools/GenerateCode.py:5–25  ·  view source on GitHub ↗
(fname)

Source from the content-addressed store, hash-verified

3import json
4
5def ParseImportFile(fname):
6 mod_dic = OrderedDict()
7 with open(fname, 'r') as src:
8 for line in src.readlines():
9 if line == '' or line == '\n':
10 continue
11 line = line.rstrip('\n')
12 mod_name, lib_name, nid_str = line.split(' ')
13 nid = int(nid_str, 16)
14
15 if not mod_name in mod_dic:
16 mod_dic[mod_name] = OrderedDict()
17
18 lib_dic = mod_dic[mod_name]
19 if not lib_name in lib_dic:
20 lib_dic[lib_name] = []
21
22 nid_list = lib_dic[lib_name]
23 nid_list.append([nid, 'null'])
24
25 return mod_dic
26
27
28# some files in ps4libdoc stands for a library

Callers 1

MainFunction · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected