gobject-introspection r270 - trunk/giscanner



Author: johan
Date: Thu May  8 23:41:07 2008
New Revision: 270
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=270&view=rev

Log:
Improve repr() for ast nodes

Modified:
   trunk/giscanner/ast.py

Modified: trunk/giscanner/ast.py
==============================================================================
--- trunk/giscanner/ast.py	(original)
+++ trunk/giscanner/ast.py	Thu May  8 23:41:07 2008
@@ -77,12 +77,18 @@
     def __init__(self, name=None):
         self.name = name
 
+    def __repr__(self):
+        return '%s(%r)' % (self.__class__.__name__, self.name)
+
 
 class Namespace(Node):
     def __init__(self, name):
         Node.__init__(self, name)
         self.nodes = []
 
+    def __repr__(self):
+        return '%s(%r, %r)' % (self.__class__.__name__, self.name,
+                               self.nodes)
 
 class Function(Node):
     def __init__(self, name, retval, parameters, symbol):
@@ -106,9 +112,6 @@
         Node.__init__(self, name)
         self.ctype = name
 
-    def __repr__(self):
-        return 'Type(%r)' % (self.name,)
-
 
 class Parameter(Node):
     def __init__(self, name, typenode):
@@ -146,9 +149,6 @@
         self.fields = []
         self.symbol = symbol
 
-    def __repr__(self):
-        return 'Struct(%r)' % (self.name,)
-
 
 class Return(Node):
     def __init__(self, type_name):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]