summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-02-03 23:25:23 +0100
committerOle Trøan <otroan@employees.org>2020-02-26 12:47:11 +0000
commiteec5d48040695e45c4880adb59bb18ebacd667c1 (patch)
treea0857785efcfdc059031d7abff0ddb653653141e
parent551775eaaa9c162c73e15690e4d7580935e9a70a (diff)
vppapigen: list imports in JSON
Type: fix Change-Id: If50477f2487d8c13f91c119a1492370e6e937904 Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
-rw-r--r--src/tools/vppapigen/vppapigen_json.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tools/vppapigen/vppapigen_json.py b/src/tools/vppapigen/vppapigen_json.py
index c2a2b7d0682..35dcbcafbbd 100644
--- a/src/tools/vppapigen/vppapigen_json.py
+++ b/src/tools/vppapigen/vppapigen_json.py
@@ -1,6 +1,12 @@
# JSON generation
import json
+def walk_imports(s):
+ r = []
+ for e in s:
+ r.append(str(e))
+ return r
+
def walk_enums(s):
r = []
@@ -75,4 +81,5 @@ def run(args, filename, s):
j['options'] = s['Option']
j['aliases'] = {o.name:o.alias for o in s['types'] if o.__class__.__name__ == 'Using'}
j['vl_api_version'] = hex(s['file_crc'])
+ j['imports'] = walk_imports(i for i in s['Import'])
return json.dumps(j, indent=4, separators=(',', ': '))