From fc1040cc47594e2a68d120cf08c0c3c70fbc44d1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 25 Jun 2014 03:04:53 +1000 Subject: Fix example --- doc/python_api/examples/mathutils.Euler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/python_api/examples') diff --git a/doc/python_api/examples/mathutils.Euler.py b/doc/python_api/examples/mathutils.Euler.py index 3f87cc0ab04..bfd2a3ed5a0 100644 --- a/doc/python_api/examples/mathutils.Euler.py +++ b/doc/python_api/examples/mathutils.Euler.py @@ -5,7 +5,7 @@ import math eul = mathutils.Euler((0.0, math.radians(45.0), 0.0), 'XYZ') # rotate the euler -eul.rotate_axis(math.radians(10.0), 'Z') +eul.rotate_axis('Z', math.radians(10.0)) # you can access its components by attribute or index print("Euler X", eul.x) -- cgit v1.2.3 From 0e0e528ea4f9529a549ab50a6a2da7a3187258a8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Sep 2014 18:36:17 +1000 Subject: Cleanup: pep8 --- doc/python_api/examples/bpy.props.5.py | 2 +- doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'doc/python_api/examples') diff --git a/doc/python_api/examples/bpy.props.5.py b/doc/python_api/examples/bpy.props.5.py index d2ace54de27..4e9d61d5385 100644 --- a/doc/python_api/examples/bpy.props.5.py +++ b/doc/python_api/examples/bpy.props.5.py @@ -75,7 +75,7 @@ print(scene.test_float) scene.test_array = (True, False) print([x for x in scene.test_array]) -#scene.test_date = "blah" # this would fail, property is read-only +# scene.test_date = "blah" # this would fail, property is read-only print(scene.test_date) scene.test_enum = 'BLUE' diff --git a/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py index 05163b332a9..a83b23e84f9 100644 --- a/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py +++ b/doc/python_api/examples/bpy.types.bpy_prop_collection.foreach_get.py @@ -8,4 +8,3 @@ collection.foreach_get(attr, some_seq) # Python equivalent for i in range(len(seq)): some_seq[i] = getattr(collection[i], attr) - -- cgit v1.2.3 From 90f75b8ce034068f0f8192e32d4b9a6d9261393f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 18 Sep 2014 17:45:31 +1000 Subject: Cleanup: use static sets where possible --- doc/python_api/examples/bpy.types.Operator.5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/python_api/examples') diff --git a/doc/python_api/examples/bpy.types.Operator.5.py b/doc/python_api/examples/bpy.types.Operator.5.py index 4a0abcb62c3..78030c7d7c4 100644 --- a/doc/python_api/examples/bpy.types.Operator.5.py +++ b/doc/python_api/examples/bpy.types.Operator.5.py @@ -39,7 +39,7 @@ class ModalOperator(bpy.types.Operator): self.execute(context) elif event.type == 'LEFTMOUSE': # Confirm return {'FINISHED'} - elif event.type in ('RIGHTMOUSE', 'ESC'): # Cancel + elif event.type in {'RIGHTMOUSE', 'ESC'}: # Cancel context.object.location.x = self.init_loc_x return {'CANCELLED'} -- cgit v1.2.3