Updated bge_api_validate_py.txt to check for undocumented attributes
All types methods and attributes are now documented (except for some types have no epydoc .py files for at all)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
BGE_API_DOC_PATH = 'source/gameengine/PyDoc'
|
||||
|
||||
import GameTypes
|
||||
type_members = {}
|
||||
|
||||
for type_name in dir(GameTypes):
|
||||
@@ -40,11 +41,48 @@ 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)
|
||||
if PRINT_OK:
|
||||
print "type: %s" % type_name
|
||||
except:
|
||||
print "missing: %s - %s" % (type_name, str(members))
|
||||
@@ -61,6 +99,12 @@ for type_name in sorted(type_members.keys()):
|
||||
for member in sorted(members):
|
||||
try:
|
||||
getattr(type_class, member)
|
||||
if PRINT_OK:
|
||||
print "\tfound: %s.%s" % (type_name, member)
|
||||
except:
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user