Updated bge_api_validate_py.txt to check for undocumented attributes
authorCampbell Barton <ideasman42@gmail.com>
Tue, 7 Apr 2009 11:45:48 +0000 (11:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 7 Apr 2009 11:45:48 +0000 (11:45 +0000)
All types methods and attributes are now documented (except for some types have no epydoc .py files for at all)

source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/PyDoc/KX_MeshProxy.py
source/gameengine/PyDoc/KX_VertexProxy.py
source/gameengine/PyDoc/SCA_RandomSensor.py
source/gameengine/PyDoc/bge_api_validate_py.txt

index f8e2938bbe66745f70de6f9a2fe3e7b1ab00263d..c90ce06b916fd5e573797f97cd928a8b066d41c9 100644 (file)
@@ -469,7 +469,7 @@ PyMethodDef KX_TrackToActuator::Methods[] = {
 
 PyAttributeDef KX_TrackToActuator::Attributes[] = {
        KX_PYATTRIBUTE_INT_RW("time",0,1000,true,KX_TrackToActuator,m_time),
-       KX_PYATTRIBUTE_BOOL_RW("user3D",KX_TrackToActuator,m_allow3D),
+       KX_PYATTRIBUTE_BOOL_RW("use3D",KX_TrackToActuator,m_allow3D),
        KX_PYATTRIBUTE_RW_FUNCTION("object", KX_TrackToActuator, pyattr_get_object, pyattr_set_object),
 
        { NULL }        //Sentinel
index 03bc36b6ac1f5c5e248bdae8b2d323c676b27013..c6855d3b0a5a3fb94da0b5a327e462dd8da8c213 100644 (file)
@@ -45,7 +45,8 @@ class KX_MeshProxy:
                        m_i += 1
                        mesh = obj.getMesh(m_i)
        
-                       
+       @ivar materials: 
+       @type materials: list of L{KX_BlenderMaterial} or L{KX_PolygonMaterial} types
        """
        
        def getNumMaterials():
index 5baaf76c3d9253b118f5d9991f7d71c0c7f1bc29..7ee5087b31610f13e12c14fb8784d91b94a770e8 100644 (file)
@@ -34,6 +34,11 @@ class KX_VertexProxy:
        @ivar v: The v texture coordinate of the vertex.
        @type v: float
        
+       @ivar u2: The second u texture coordinate of the vertex.
+       @type u2: float
+       @ivar v2: The second v texture coordinate of the vertex.
+       @type v2: float
+       
        @group Colour: r, g, b, a
        @ivar r: The red component of the vertex colour.   0.0 <= r <= 1.0
        @type r: float
index 940b8f879ffd257b1e425d4bf817586e4a1c8409..6dc0a3c23c0377a784d46b5d8fbe5c93a86368dd 100644 (file)
@@ -5,6 +5,11 @@ from SCA_ISensor import *
 class SCA_RandomSensor(SCA_ISensor):
        """
        This sensor activates randomly.
+
+       @ivar lastDraw: The seed of the random number generator.
+       @type lastDraw: int
+       @ivar seed: The seed of the random number generator.
+       @type seed: int
        """
        
        def setSeed(seed):
@@ -25,4 +30,6 @@ class SCA_RandomSensor(SCA_ISensor):
        def getLastDraw():
                """
                Returns the last random number generated.
+               
+               @rtype: integer
                """
index e003f29831b9c26c7b9b99dcc9d85686c0fefed4..58dfbadba15a04b7802fdc6cf09c7b5e72e0867b 100644 (file)
@@ -15,6 +15,7 @@
 
 BGE_API_DOC_PATH = 'source/gameengine/PyDoc'
 
+import GameTypes
 type_members = {}
 
 for type_name in dir(GameTypes):
@@ -40,12 +41,49 @@ doc_dir= os.path.join(os.getcwd(), BGE_API_DOC_PATH)
 if doc_dir not in sys.path:
        sys.path.append(doc_dir)
 
+
+def check_attribute(type_mame, member):
+       filename =      os.path.join(doc_dir, type_mame + '.py')
+       # print filename
+       
+       file = open(filename, 'rU')
+       
+       for l in file:
+               l = l.strip()
+               
+               '''
+                       @ivar foo: blah blah
+               to
+                       foo
+                       
+               '''
+               
+               if l.startswith('@ivar'):
+                       var = l.split()[1].split(':')[0]
+                       
+                       if var == member:
+                               file.close()
+                               return True
+       
+       file.close()
+       return False
+       
+       
+       
+       
+
+
+print '\n\n\nChecking Docs'
+
+PRINT_OK = False
+
 for type_name in sorted(type_members.keys()):
        members = type_members[type_name]
        
        try:
                mod = __import__(type_name)
-               print "type: %s" % type_name
+               if PRINT_OK:
+                       print "type: %s" % type_name
        except:
                print "missing: %s - %s" % (type_name, str(members))
                continue
@@ -61,6 +99,12 @@ for type_name in sorted(type_members.keys()):
        for member in sorted(members):
                try:
                        getattr(type_class, member)
-                       print "\tfound: %s.%s" % (type_name, member)
+                       if PRINT_OK:
+                               print "\tfound: %s.%s" % (type_name, member)
                except:
-                       print "\tmissing: %s.%s" % (type_name, member)  
+                       if check_attribute(type_name, member):
+                               if PRINT_OK:
+                                       print "\tfound attr: %s.%s" % (type_name, member)
+                       else:
+                               print "\tmissing: %s.%s" % (type_name, member)
+