[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35983] trunk/blender: fix [#26757] Python console: help() doesn't work anymore

Campbell Barton ideasman42 at gmail.com
Mon Apr 4 01:11:00 CEST 2011


Revision: 35983
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35983
Author:   campbellbarton
Date:     2011-04-03 23:11:00 +0000 (Sun, 03 Apr 2011)
Log Message:
-----------
fix [#26757] Python console: help() doesn't work anymore
also quiet some warnings & add docstrings to bpy module which was shaowing the GPL header in its help() message.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy/__init__.py
    trunk/blender/release/scripts/modules/console_python.py
    trunk/blender/source/blender/makesrna/intern/rna_constraint.c

Modified: trunk/blender/release/scripts/modules/bpy/__init__.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/__init__.py	2011-04-03 22:28:33 UTC (rev 35982)
+++ trunk/blender/release/scripts/modules/bpy/__init__.py	2011-04-03 23:11:00 UTC (rev 35983)
@@ -18,6 +18,10 @@
 
 # <pep8 compliant>
 
+"""
+Give access to blender data and utility functions.
+"""
+
 # internal blender C module
 import _bpy
 from _bpy import types, props, app

Modified: trunk/blender/release/scripts/modules/console_python.py
===================================================================
--- trunk/blender/release/scripts/modules/console_python.py	2011-04-03 22:28:33 UTC (rev 35982)
+++ trunk/blender/release/scripts/modules/console_python.py	2011-04-03 23:11:00 UTC (rev 35983)
@@ -34,7 +34,7 @@
 
 
 def replace_help(namespace):
-    def _help(value):
+    def _help(*args):
         # because of how the console works. we need our own help() pager func.
         # replace the bold function because it adds crazy chars
         import pydoc
@@ -42,7 +42,7 @@
         pydoc.Helper.getline = lambda self, prompt: None
         pydoc.TextDoc.use_bold = lambda self, text: text
 
-        help(value)
+        pydoc.help(*args)
 
     namespace["help"] = _help
 

Modified: trunk/blender/source/blender/makesrna/intern/rna_constraint.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_constraint.c	2011-04-03 22:28:33 UTC (rev 35982)
+++ trunk/blender/source/blender/makesrna/intern/rna_constraint.c	2011-04-03 23:11:00 UTC (rev 35983)
@@ -82,25 +82,13 @@
 	{1, "LOCAL", 0, "Local Space", ""},
 	{0, NULL, 0, NULL, NULL}};
 
+#ifdef RNA_RUNTIME
+
 static EnumPropertyItem space_object_items[] = {
 	{0, "WORLD", 0, "World Space", ""},
 	{1, "LOCAL", 0, "Local Space", ""},
 	{0, NULL, 0, NULL, NULL}};
 
-static EnumPropertyItem constraint_ik_type_items[] ={
-	{CONSTRAINT_IK_COPYPOSE, "COPY_POSE", 0, "Copy Pose", ""},
-	{CONSTRAINT_IK_DISTANCE, "DISTANCE", 0, "Distance", ""},
-	{0, NULL, 0, NULL, NULL},
-};
-
-static EnumPropertyItem constraint_ik_axisref_items[] ={
-	{0, "BONE", 0, "Bone", ""},
-	{CONSTRAINT_IK_TARGETAXIS, "TARGET", 0, "Target", ""},
-	{0, NULL, 0, NULL, NULL},
-};
-
-#ifdef RNA_RUNTIME
-
 #include "BKE_animsys.h"
 #include "BKE_action.h"
 #include "BKE_constraint.h"
@@ -466,6 +454,18 @@
 	StructRNA *srna;
 	PropertyRNA *prop;
 
+	static EnumPropertyItem constraint_ik_axisref_items[] ={
+		{0, "BONE", 0, "Bone", ""},
+		{CONSTRAINT_IK_TARGETAXIS, "TARGET", 0, "Target", ""},
+		{0, NULL, 0, NULL, NULL},
+	};
+
+	static EnumPropertyItem constraint_ik_type_items[] ={
+		{CONSTRAINT_IK_COPYPOSE, "COPY_POSE", 0, "Copy Pose", ""},
+		{CONSTRAINT_IK_DISTANCE, "DISTANCE", 0, "Distance", ""},
+		{0, NULL, 0, NULL, NULL},
+	};
+
 	srna= RNA_def_struct(brna, "KinematicConstraint", "Constraint");
 	RNA_def_struct_ui_text(srna, "Kinematic Constraint", "Inverse Kinematics");
 	RNA_def_struct_sdna_from(srna, "bKinematicConstraint", "data");




More information about the Bf-blender-cvs mailing list