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
path: root/doc
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-09-09 03:59:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-09 03:59:47 +0400
commit4eb9b9e4f1b8aec1e939bd6ca5f60728d5902448 (patch)
tree43970898343693c351e688b198264bea682469e3 /doc
parent899bd19c7150cb401e90c5c844d14fe6c7757ae2 (diff)
bpy api - add new page for best-practice (so Thomas has something to point to when kicking devs for writing shoddy UI layouts)
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/rst/info_best_practice.rst65
-rw-r--r--doc/python_api/rst/info_quickstart.rst46
-rw-r--r--doc/python_api/sphinx_doc_gen.py1
3 files changed, 66 insertions, 46 deletions
diff --git a/doc/python_api/rst/info_best_practice.rst b/doc/python_api/rst/info_best_practice.rst
new file mode 100644
index 00000000000..2fbc636613c
--- /dev/null
+++ b/doc/python_api/rst/info_best_practice.rst
@@ -0,0 +1,65 @@
+*************
+Best Practice
+*************
+
+
+TODO: Intro text
+
+
+Style Conventions
+=================
+
+For Blender 2.5 we have chosen to follow python suggested style guide to avoid mixing styles amongst our own scripts and make it easier to use python scripts from other projects.
+
+Using our style guide for your own scripts makes it easier if you eventually want to contribute them to blender.
+
+This style guide is known as pep8 and can be found `here <http://www.python.org/dev/peps/pep-0008>`_
+
+A brief listing of pep8 criteria.
+
+* camel caps for class names: MyClass
+
+* all lower case underscore separated module names: my_module
+
+* indentation of 4 spaces (no tabs)
+
+* spaces around operators. ``1 + 1``, not ``1+1``
+
+* only use explicit imports, (no importing '*')
+
+* don't use single line: ``if val: body``, separate onto 2 lines instead.
+
+
+As well as pep8 we have other conventions used for blender python scripts.
+
+* Use single quotes for enums, and double quotes for strings.
+
+ Both are of course strings but in our internal API enums are unique items from a limited set. eg.
+
+ .. code-block:: python
+
+ bpy.context.scene.render.file_format = 'PNG'
+ bpy.context.scene.render.filepath = "//render_out"
+
+* pep8 also defines that lines should not exceed 79 characters, we felt this is too restrictive so this is optional per script.
+
+Periodically we run checks for pep8 compliance on blender scripts, for scripts to be included in this check add this line as a comment at the top of the script.
+
+``# <pep8 compliant>``
+
+To enable line length checks use this instead.
+
+``# <pep8-80 compliant>``
+
+
+User Interface Layout
+=====================
+
+TODO: Thomas
+
+
+Script Efficiency
+=================
+
+TODO: Campbell
+
diff --git a/doc/python_api/rst/info_quickstart.rst b/doc/python_api/rst/info_quickstart.rst
index 751e5e1ec61..e7f2900b212 100644
--- a/doc/python_api/rst/info_quickstart.rst
+++ b/doc/python_api/rst/info_quickstart.rst
@@ -420,49 +420,3 @@ Using Low-Level Functions:
fcu_z.keyframe_points[0].co = 10.0, 0.0
fcu_z.keyframe_points[1].co = 20.0, 1.0
-
-Style Conventions
-=================
-
-For Blender 2.5 we have chosen to follow python suggested style guide to avoid mixing styles amongst our own scripts and make it easier to use python scripts from other projects.
-
-Using our style guide for your own scripts makes it easier if you eventually want to contribute them to blender.
-
-This style guide is known as pep8 and can be found `here <http://www.python.org/dev/peps/pep-0008>`_
-
-A brief listing of pep8 criteria.
-
-* camel caps for class names: MyClass
-
-* all lower case underscore separated module names: my_module
-
-* indentation of 4 spaces (no tabs)
-
-* spaces around operators. ``1 + 1``, not ``1+1``
-
-* only use explicit imports, (no importing '*')
-
-* don't use single line: ``if val: body``, separate onto 2 lines instead.
-
-
-As well as pep8 we have other conventions used for blender python scripts.
-
-* Use single quotes for enums, and double quotes for strings.
-
- Both are of course strings but in our internal API enums are unique items from a limited set. eg.
-
- .. code-block:: python
-
- bpy.context.scene.render.file_format = 'PNG'
- bpy.context.scene.render.filepath = "//render_out"
-
-* pep8 also defines that lines should not exceed 79 characters, we felt this is too restrictive so this is optional per script.
-
-Periodically we run checks for pep8 compliance on blender scripts, for scripts to be included in this check add this line as a comment at the top of the script.
-
-``# <pep8 compliant>``
-
-To enable line length checks use this instead.
-
-``# <pep8-80 compliant>``
-
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index a7657fad432..ac2a498efc2 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -103,6 +103,7 @@ sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
INFO_DOCS = (
("info_quickstart.rst", "Blender/Python Quickstart: new to blender/scripting and want to get you're feet wet?"),
("info_overview.rst", "Blender/Python API Overview: a more complete explanation of python integration"),
+ ("info_best_practice.rst", "Best Practice: Conventions to follow for writing good scripts"),
("info_tips_and_tricks.rst", "Tips and Tricks: Hints to help you while writeing scripts for blender"),
("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"),
)