diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-25 19:19:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-25 19:19:50 +0300 |
commit | bc15e0e2952bac0458ae61c97d4d8187e55cd1cc (patch) | |
tree | f8bd0ad1e724d8a867caadff7778c484047a0d51 /doc | |
parent | b25db7c8cb3bf41e19b99c0d3c83b27bfa8d23d6 (diff) |
add NDEBUG to scons release flags + some pep8 cleanup for examples.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/python_api/examples/bpy.ops.py | 2 | ||||
-rw-r--r-- | doc/python_api/examples/bpy.props.3.py | 3 | ||||
-rw-r--r-- | doc/python_api/examples/bpy.types.Menu.1.py | 2 | ||||
-rw-r--r-- | doc/python_api/examples/bpy.types.Menu.2.py | 1 | ||||
-rw-r--r-- | doc/python_api/examples/bpy.types.Menu.py | 2 | ||||
-rw-r--r-- | doc/python_api/examples/bpy.types.Operator.5.py | 5 | ||||
-rw-r--r-- | doc/python_api/examples/bpy.types.Panel.1.py | 1 | ||||
-rw-r--r-- | doc/python_api/examples/bpy.types.Panel.2.py | 1 | ||||
-rw-r--r-- | doc/python_api/sphinx_doc_gen.py | 2 |
9 files changed, 10 insertions, 9 deletions
diff --git a/doc/python_api/examples/bpy.ops.py b/doc/python_api/examples/bpy.ops.py index 487d6039327..20e8773652d 100644 --- a/doc/python_api/examples/bpy.ops.py +++ b/doc/python_api/examples/bpy.ops.py @@ -27,4 +27,4 @@ bpy.ops.mesh.subdivide(number_cuts=3, smoothness=0.5) # check poll() to avoid exception. if bpy.ops.object.mode_set.poll(): - bpy.ops.object.mode_set(mode='EDIT') + bpy.ops.object.mode_set(mode='EDIT') diff --git a/doc/python_api/examples/bpy.props.3.py b/doc/python_api/examples/bpy.props.3.py index e4964c366cf..e0b2cf419d2 100644 --- a/doc/python_api/examples/bpy.props.3.py +++ b/doc/python_api/examples/bpy.props.3.py @@ -8,6 +8,7 @@ Custom properties can be added to any subclass of an :class:`ID`, import bpy + # Assign a collection class SceneSettingItem(bpy.types.PropertyGroup): name = bpy.props.StringProperty(name="Test Prop", default="Unknown") @@ -30,4 +31,4 @@ my_item.name = "Eggs" my_item.value = 30 for my_item in bpy.context.scene.my_settings: - print(my_item.name, my_item.value) + print(my_item.name, my_item.value) diff --git a/doc/python_api/examples/bpy.types.Menu.1.py b/doc/python_api/examples/bpy.types.Menu.1.py index fa23e2dcfd3..92c961e93d2 100644 --- a/doc/python_api/examples/bpy.types.Menu.1.py +++ b/doc/python_api/examples/bpy.types.Menu.1.py @@ -12,7 +12,7 @@ class SubMenu(bpy.types.Menu): def draw(self, context): layout = self.layout - + layout.operator("object.select_all", text="Select/Deselect All") layout.operator("object.select_inverse", text="Inverse") layout.operator("object.select_random", text="Random") diff --git a/doc/python_api/examples/bpy.types.Menu.2.py b/doc/python_api/examples/bpy.types.Menu.2.py index 4579dd6c485..c87b10cb6e7 100644 --- a/doc/python_api/examples/bpy.types.Menu.2.py +++ b/doc/python_api/examples/bpy.types.Menu.2.py @@ -10,6 +10,7 @@ The function menu_draw acts like Menu.draw """ import bpy + def menu_draw(self, context): self.layout.operator("wm.save_homefile") diff --git a/doc/python_api/examples/bpy.types.Menu.py b/doc/python_api/examples/bpy.types.Menu.py index a6abba6bfad..3fbc0f6a8f0 100644 --- a/doc/python_api/examples/bpy.types.Menu.py +++ b/doc/python_api/examples/bpy.types.Menu.py @@ -20,7 +20,7 @@ class BasicMenu(bpy.types.Menu): def draw(self, context): layout = self.layout - + layout.operator("object.select_all", text="Select/Deselect All") layout.operator("object.select_inverse", text="Inverse") layout.operator("object.select_random", text="Random") diff --git a/doc/python_api/examples/bpy.types.Operator.5.py b/doc/python_api/examples/bpy.types.Operator.5.py index fd09120d3b0..7d1a98d4c34 100644 --- a/doc/python_api/examples/bpy.types.Operator.5.py +++ b/doc/python_api/examples/bpy.types.Operator.5.py @@ -25,7 +25,7 @@ class ModalOperator(bpy.types.Operator): def __init__(self): print("Start") - + def __del__(self): print("End") @@ -33,7 +33,7 @@ class ModalOperator(bpy.types.Operator): context.object.location.x = self.value / 100.0 def modal(self, context, event): - if event.type == 'MOUSEMOVE': # Apply + if event.type == 'MOUSEMOVE': # Apply self.value = event.mouse_x self.execute(context) elif event.type == 'LEFTMOUSE': # Confirm @@ -51,7 +51,6 @@ class ModalOperator(bpy.types.Operator): return {'RUNNING_MODAL'} - bpy.utils.register_class(ModalOperator) # test call diff --git a/doc/python_api/examples/bpy.types.Panel.1.py b/doc/python_api/examples/bpy.types.Panel.1.py index afe9493438e..ab32a043706 100644 --- a/doc/python_api/examples/bpy.types.Panel.1.py +++ b/doc/python_api/examples/bpy.types.Panel.1.py @@ -23,7 +23,6 @@ class ObjectSelectPanel(bpy.types.Panel): layout = self.layout obj = context.object layout.prop(obj, "select", text="") - def draw(self, context): layout = self.layout diff --git a/doc/python_api/examples/bpy.types.Panel.2.py b/doc/python_api/examples/bpy.types.Panel.2.py index 661d7cba766..a4b2f1fd338 100644 --- a/doc/python_api/examples/bpy.types.Panel.2.py +++ b/doc/python_api/examples/bpy.types.Panel.2.py @@ -6,6 +6,7 @@ A mix-in parent class can be used to share common properties and """ import bpy + class View3DPanel(): bl_space_type = 'VIEW_3D' bl_region_type = 'TOOLS' diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 8058ebeb137..e10d5c5cf9a 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -782,7 +782,7 @@ def pyrna2sphinx(BASEPATH): for op in ops.values(): op_modules.setdefault(op.module_name, []).append(op) del op - + for op_module_name, ops_mod in op_modules.items(): filepath = os.path.join(BASEPATH, "bpy.ops.%s.rst" % op_module_name) file = open(filepath, "w") |