# HG changeset patch # User Paul Boddie # Date 1267924878 -3600 # Node ID 02757ef74c891afa6540d504e1454a3047db3f99 # Parent 54cb8a2fff313e7910c7c0feb1b7fcb1d92ec538 Removed links to "" in the graph output. Added the special filename "-" as a replacement for the filename argument in the test program, loading the micropython module for test purposes. diff -r 54cb8a2fff31 -r 02757ef74c89 micropython/graph.py --- a/micropython/graph.py Sun Mar 07 01:49:29 2010 +0100 +++ b/micropython/graph.py Sun Mar 07 02:21:18 2010 +0100 @@ -3,7 +3,7 @@ """ A module providing elementary graph support for programs. -Copyright (C) 2008 Paul Boddie +Copyright (C) 2008, 2009, 2010 Paul Boddie This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -83,13 +83,13 @@ if isinstance(obj, micropython.inspect.Class): for attr in obj.all_attributes().values(): for value in attr.get_values(): - if value is not None: - print >>out, ' "%s":%s -> "%s";' % (obj.full_name(), attr.name, get_name(value)) + if value is not None and get_name(value) is not None: + print >>out, ' "%s":"%s" -> "%s";' % (obj.full_name(), attr.name, get_name(value)) elif isinstance(obj, micropython.inspect.Function): for attr in obj.all_locals().values(): for value in attr.get_values(): - if value is not None: - print >>out, ' "%s":%s -> "%s";' % (obj.full_name(), attr.name, get_name(value)) + if value is not None and get_name(value) is not None: + print >>out, ' "%s":"%s" -> "%s";' % (obj.full_name(), attr.name, get_name(value)) print >>out, ' }' print >>out, "}" @@ -100,6 +100,6 @@ elif isinstance(obj, micropython.data.Const): return obj.value_type_name() else: - return "" + return None # vim: tabstop=4 expandtab shiftwidth=4 diff -r 54cb8a2fff31 -r 02757ef74c89 test.py --- a/test.py Sun Mar 07 01:49:29 2010 +0100 +++ b/test.py Sun Mar 07 02:21:18 2010 +0100 @@ -31,7 +31,7 @@ print micropython.cmd.show_optimisations() sys.exit(1) - if len(sys.argv) > 1: + if len(sys.argv) > 1 and sys.argv[1] != "-": filename = os.path.abspath(sys.argv[1]) path.append(os.path.split(filename)[0]) else: