changeset 1:c17df2133c3d

Print more info about IDL
author Atul Varma <avarma@mozilla.com>
date Fri, 16 Apr 2010 18:47:29 -0700
parents 0987c2523a33
children dc37f719de33
files idlexperiment.py
diffstat 1 files changed, 19 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/idlexperiment.py	Mon Apr 12 21:24:44 2010 -0700
+++ b/idlexperiment.py	Fri Apr 16 18:47:29 2010 -0700
@@ -8,7 +8,24 @@
     idl.resolve(["idl"], parser)
     for thing in idl.getNames():
         if isinstance(thing, xpidl.Interface):
-            print thing.name
+            print "Interface %s" % thing.name
             for prop in thing.namemap:
                 if isinstance(prop, xpidl.Method):
-                    print "%s - %s" % (prop.name, prop.type)
+                    args = []
+                    for param in prop.params:
+                        args.append("%s %s" % (param.type, param.name))
+                    arglist = "(%s)" % (", ".join(args))
+                    print "  %s %s.%s%s" % (prop.type,
+                                            thing.name, prop.name,
+                                            arglist)
+                elif isinstance(prop, xpidl.Attribute):
+                    print "  attribute %s %s readonly=%s" % (prop.type,
+                                                             prop.name,
+                                                             prop.readonly)
+                elif isinstance(prop, xpidl.ConstMember):
+                    print "  %s %s = %s" % (prop.type,
+                                            prop.name,
+                                            prop.getValue())
+                else:
+                    print "TODO: %s" % prop.__class__.__name__
+