From: Jacob Lifshay Date: Tue, 6 Sep 2022 08:48:03 +0000 (-0700) Subject: format code X-Git-Tag: opf_rfc_ls005_v1~658 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=64204955ffb5d7c6e71ac764bf1786929111ef2a;p=libreriscv.git format code --- diff --git a/openpower/pandoc_img.py b/openpower/pandoc_img.py index ec440c450..55c1d7317 100755 --- a/openpower/pandoc_img.py +++ b/openpower/pandoc_img.py @@ -12,9 +12,10 @@ the paragraphs are joined by a space. But if an input note had any blocks other than paragraphs, the note is left as is. """ -#inkscape -z sv/bridge_phy.svg --export-png=bridge.png +# inkscape -z sv/bridge_phy.svg --export-png=bridge.png out = open("/tmp/log.txt", "w") + def query(k, v, f, meta): global inlines if k == 'BlockQuote': @@ -25,9 +26,10 @@ def query(k, v, f, meta): inlines.extend(v) return v + def inlinenotes(k, v, f, meta): - out.write("k v f meta %s %s %s %s\n" % \ - (repr(k), repr(v), repr(f), repr(meta))) + out.write("k v f meta %s %s %s %s\n" % + (repr(k), repr(v), repr(f), repr(meta))) global inlines inlines = [] if k == u'Image' and f == 'latex': @@ -41,7 +43,7 @@ def inlinenotes(k, v, f, meta): png = "tex_out/%s" % png subprocess.run(["inkscape", "-z", "-C", imgname, "--export-png=%s" % png], - stdout=subprocess.PIPE) + stdout=subprocess.PIPE) v[2][0] = png return Image(*v) if k == 'Str' and f == 'latex': @@ -79,35 +81,35 @@ def inlinenotes(k, v, f, meta): 'sv/svp64_quirks': 'SVP64 Quirks', 'openpower/isa/simplev': 'Simple-V pseudocode', 'opcode_regs_deduped': 'SVP64 Augmentation Table', - 'sv/av_opcodes' : 'Audio and Video Opcodes', - 'av_opcodes' : 'Audio and Video Opcodes', - 'sv/vector_ops' : 'SV Vector ops', - 'sv/int_fp_mv' : 'FP/Int Conversion ops', - 'sv/bitmanip' : 'Bitmanip ops', - 'sv/cr_int_predication' : 'CR Weird ops', - 'cr_int_predication' : 'CR Weird ops', - 'sv/fclass' : 'FP Class ops', - 'sv/biginteger' : 'Big Integer', - 'sv/biginteger/analysis' : 'Big Integer Analysis', - 'isa/svfparith' : 'Floating Point pseudocode', - 'isa/svfixedarith' : 'Fixed Point pseudocode', - 'openpower/isa/branch' : 'Branch pseudocode', - 'openpower/transcendentals' : 'Transcendentals', - } + 'sv/av_opcodes': 'Audio and Video Opcodes', + 'av_opcodes': 'Audio and Video Opcodes', + 'sv/vector_ops': 'SV Vector ops', + 'sv/int_fp_mv': 'FP/Int Conversion ops', + 'sv/bitmanip': 'Bitmanip ops', + 'sv/cr_int_predication': 'CR Weird ops', + 'cr_int_predication': 'CR Weird ops', + 'sv/fclass': 'FP Class ops', + 'sv/biginteger': 'Big Integer', + 'sv/biginteger/analysis': 'Big Integer Analysis', + 'isa/svfparith': 'Floating Point pseudocode', + 'isa/svfixedarith': 'Fixed Point pseudocode', + 'openpower/isa/branch': 'Branch pseudocode', + 'openpower/transcendentals': 'Transcendentals', + } if link in lookups: out.write(" found %s\n" % lookups[link]) return [Link(['', [], []], - [Str("{"+lookups[link]+"}")], - ['#%s' % link, '']), Str(v[find_brack+2:])] + [Str("{"+lookups[link]+"}")], + ['#%s' % link, '']), Str(v[find_brack+2:])] if '|' in link: link, ref = link.split("|") return [Link(['', [], []], - [Str(link)], - [ref, '']), Str(v[find_brack+2:])] + [Str(link)], + [ref, '']), Str(v[find_brack+2:])] if k == 'Link': - out.write(" link type %s\n" % \ - (type(v[1][0]))) - + out.write(" link type %s\n" % + (type(v[1][0]))) + if __name__ == "__main__": toJSONFilter(inlinenotes)