1.1 --- a/micropython/graph.py Sun Mar 07 01:49:29 2010 +0100
1.2 +++ b/micropython/graph.py Sun Mar 07 02:21:18 2010 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 A module providing elementary graph support for programs.
1.6
1.7 -Copyright (C) 2008 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2008, 2009, 2010 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -83,13 +83,13 @@
1.13 if isinstance(obj, micropython.inspect.Class):
1.14 for attr in obj.all_attributes().values():
1.15 for value in attr.get_values():
1.16 - if value is not None:
1.17 - print >>out, ' "%s":%s -> "%s";' % (obj.full_name(), attr.name, get_name(value))
1.18 + if value is not None and get_name(value) is not None:
1.19 + print >>out, ' "%s":"%s" -> "%s";' % (obj.full_name(), attr.name, get_name(value))
1.20 elif isinstance(obj, micropython.inspect.Function):
1.21 for attr in obj.all_locals().values():
1.22 for value in attr.get_values():
1.23 - if value is not None:
1.24 - print >>out, ' "%s":%s -> "%s";' % (obj.full_name(), attr.name, get_name(value))
1.25 + if value is not None and get_name(value) is not None:
1.26 + print >>out, ' "%s":"%s" -> "%s";' % (obj.full_name(), attr.name, get_name(value))
1.27 print >>out, ' }'
1.28
1.29 print >>out, "}"
1.30 @@ -100,6 +100,6 @@
1.31 elif isinstance(obj, micropython.data.Const):
1.32 return obj.value_type_name()
1.33 else:
1.34 - return "<None>"
1.35 + return None
1.36
1.37 # vim: tabstop=4 expandtab shiftwidth=4