docs/tools/codegrab.py
changeset 271 574511abf998
parent 256 0dedfa161b21
child 287 bbd0eb35aee8
--- a/docs/tools/codegrab.py	Wed Jun 14 21:17:30 2000 +0000
+++ b/docs/tools/codegrab.py	Wed Jun 14 21:22:52 2000 +0000
@@ -54,11 +54,14 @@
     result = Struct()
     result.functions = []
     result.classes = []
+    result.doc = mod.__doc__
     for name in dir(mod):
         value = getattr(mod, name)
         if type(value) is types.FunctionType:
+            path, file = os.path.split(value.func_code.co_filename)
+            root, ext = os.path.splitext(file)
             #we're possibly interested in it
-            if os.path.splitext(value.func_code.co_filename)[0] == modulename:
+            if root == modulename:
                 #it was defined here
                 funcObj = value
                 fn = Struct()
@@ -68,6 +71,14 @@
                     fn.doc = dedent(funcObj.__doc__)
                 else:
                     fn.doc = '(no documentation string)'
+                #is it official?
+                if name[0:1] == '_':
+                     fn.status = 'private'
+                elif name[-1] in '0123456789':
+                    fn.status = 'experimental'
+                else:
+                    fn.status = 'official'
+                        
                 result.functions.append(fn)
         elif type(value) == types.ClassType:
             if value.__module__ == modulename:
@@ -81,6 +92,12 @@
                 cl.bases = []
                 for base in value.__bases__:
                     cl.bases.append(base.__name__)
+                if name[0:1] == '_':
+                    cl.status = 'private'
+                elif name[-1] in '0123456789':
+                    cl.status = 'experimental'
+                else:
+                    cl.status = 'official'
                 
                 cl.methods = []
                 #loop over dict finding methods defined here