From aa33e6ebaec39501e9bf9b9bca21aa310aea8114 Mon Sep 17 00:00:00 2001 From: Muthu Annamalai Date: Thu, 29 Feb 2024 00:15:08 -0800 Subject: [PATCH] - support for running as $ python3 -m smop ${args} - support for networkx module 3.2.1 --- smop/__main__.py | 5 +++++ smop/resolve.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 smop/__main__.py diff --git a/smop/__main__.py b/smop/__main__.py new file mode 100644 index 00000000..04b1c9ac --- /dev/null +++ b/smop/__main__.py @@ -0,0 +1,5 @@ +from .main import main + +if __name__ == '__main__': + main() + diff --git a/smop/resolve.py b/smop/resolve.py index 1e4b16f6..0bbc5fe2 100644 --- a/smop/resolve.py +++ b/smop/resolve.py @@ -51,7 +51,7 @@ def resolve(t, symtab=None, fp=None, func_name=None): G = as_networkx(t) for n in G.nodes(): print(n.__class__.__name__) - u = G.node[n]["ident"] + u = G.nodes[n]["ident"] if u.props: pass elif G.out_edges(n) and G.in_edges(n): @@ -63,7 +63,7 @@ def resolve(t, symtab=None, fp=None, func_name=None): u.props = "R" # ref else: u.props = "F" # ??? - G.node[n]["label"] = "%s\\n%s" % (n, u.props) + G.nodes[n]["label"] = "%s\\n%s" % (n, u.props) return G def do_resolve(t,symtab):