From 66f9bc2f4ce9dfb7f90369fc23c3093c2e7835bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Wed, 22 Dec 2021 22:44:31 +0100 Subject: Complete rewrite of use2dot Old version tried to leverage guile's built in use2dot, and then modified it to fit my needs. This new version implements its own use2dot, using the same underlying mechanism as guile's built in, giving us FAR greater flexability. --- use2dot/change_graph.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100755 use2dot/change_graph.py (limited to 'use2dot/change_graph.py') diff --git a/use2dot/change_graph.py b/use2dot/change_graph.py deleted file mode 100755 index 50d1c34f..00000000 --- a/use2dot/change_graph.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python3 - -import re -import colorsys -import hashlib -import sys - -def md5(str): - return hashlib.md5(str.encode("UTF-8")).hexdigest() - -def rgb(str): - return md5(str)[0:6] - -def main(args): - - if len(args) < 3: - print("Usage: ./change_graph.py ") - return - - [_, infile, outfile, *rest] = args - - with open(infile) as f: - lines = f.readlines() - # [3:-1] - - f = open(outfile, 'w') - - for line in lines: - m = re.search('^( *"\(([^)]*)\)" -> "(\([^)]*\))");', line) - if m: - f.write(f'{m.group(1)} [color="#{rgb(m.group(2))}"];\n') - else: - f.write(line) - # colorsys.hsv_to_rgb( - - -# "(server macro)" -> "(ice-9 regex)"; - -if __name__ == "__main__": - main(sys.argv) -- cgit v1.2.3