Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine/PyDoc/bge_api_validate_py.txt')
-rw-r--r--source/gameengine/PyDoc/bge_api_validate_py.txt39
1 files changed, 37 insertions, 2 deletions
diff --git a/source/gameengine/PyDoc/bge_api_validate_py.txt b/source/gameengine/PyDoc/bge_api_validate_py.txt
index 0920e5d3c7d..492dcef408b 100644
--- a/source/gameengine/PyDoc/bge_api_validate_py.txt
+++ b/source/gameengine/PyDoc/bge_api_validate_py.txt
@@ -12,9 +12,17 @@
#
# Currently it only prints missing modules and methods (not attributes)
+import sys, os
BGE_API_DOC_PATH = 'source/gameengine/PyDoc'
+
+mods = ['GameLogic', 'Rasterizer', 'GameKeys']
+mods_dict = {}
+for m in mods:
+ mods_dict[m] = sys.modules[m]
+
+
import GameTypes
type_members = {}
@@ -34,7 +42,7 @@ for type_name in dir(GameTypes):
# print type_object.__name__ + '.' + k
members.append(member)
-import sys, os
+
doc_dir= os.path.join(os.getcwd(), BGE_API_DOC_PATH)
@@ -58,7 +66,7 @@ def check_attribute(type_mame, member):
'''
- if l.startswith('@ivar'):
+ if l.startswith('@ivar') or l.startswith('@var'):
var = l.split()[1].split(':')[0]
if var == member:
@@ -108,3 +116,30 @@ for type_name in sorted(type_members.keys()):
else:
print "\tmissing: %s.%s" % (type_name, member)
+
+# Now check the modules
+for mod_name, pymod in mods_dict.iteritems():
+ print pymod
+ del sys.modules[mod_name]
+
+ # Now well get the python version
+ pydoc = __import__(mod_name)
+ pydoc = reload(pydoc) # avoid using the out dated pyc file only
+ print pydoc.__file__
+
+ for member in sorted(dir(pymod)):
+ if hasattr(pydoc, member) or check_attribute(mod_name, member):
+ if PRINT_OK:
+ print "\tfound module attr: %s.%s" % (mod_name, member)
+ else:
+ print "\tmissing module attr: %s.%s" % (mod_name, member)
+
+ # Restore real module
+ sys.modules[mod_name] = pymod
+
+
+sys.path.pop() # remove the pydoc dir from our import paths
+
+
+
+