[Bf-blender-cvs] [0c538fc9238] master: Cleanup: spelling, grammar, and other corrections

Campbell Barton noreply at git.blender.org
Fri Jun 21 02:19:16 CEST 2019


Commit: 0c538fc923803c8611c3c7c7af9ca51fc5293b75
Author: Campbell Barton
Date:   Fri Jun 21 09:50:23 2019 +1000
Branches: master
https://developer.blender.org/rB0c538fc923803c8611c3c7c7af9ca51fc5293b75

Cleanup: spelling, grammar, and other corrections

D5084 by @nBurn with edits

===================================================================

M	doc/python_api/examples/bpy.types.Operator.5.py
M	release/scripts/modules/addon_utils.py
M	source/blender/python/generic/blf_py_api.c
M	source/blender/python/intern/bpy_app.c
M	source/blender/python/intern/bpy_interface_atexit.c
M	source/blender/python/intern/bpy_library_load.c
M	source/blender/python/intern/bpy_props.c
M	source/blender/python/intern/bpy_rna.c

===================================================================

diff --git a/doc/python_api/examples/bpy.types.Operator.5.py b/doc/python_api/examples/bpy.types.Operator.5.py
index c1a49a756a0..f1880a70018 100644
--- a/doc/python_api/examples/bpy.types.Operator.5.py
+++ b/doc/python_api/examples/bpy.types.Operator.5.py
@@ -11,8 +11,8 @@ will not run. Modal operators are especially useful for interactive tools, an
 operator can have its own state where keys toggle options as the operator runs.
 Grab, Rotate, Scale, and Fly-Mode are examples of modal operators.
 
-:class:`Operator.invoke` is used to initialize the operator as being by
-returning ``{'RUNNING_MODAL'}``, initializing the modal loop.
+:class:`Operator.invoke` is used to initialize the operator as being active
+by returning ``{'RUNNING_MODAL'}``, initializing the modal loop.
 
 Notice ``__init__()`` and ``__del__()`` are declared.
 For other operator types they are not useful but for modal operators they will
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index 3ff296d0be9..70768a102b3 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -342,8 +342,8 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non
     # Split registering up into 3 steps so we can undo
     # if it fails par way through.
 
-    # disable the context, using the context at all is
-    # really bad while loading an addon, don't do it!
+    # Disable the context: using the context at all
+    # while loading an addon is really bad, don't do it!
     with RestrictBlend():
 
         # 1) try import
@@ -362,16 +362,16 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non
                 _addon_remove(module_name)
             return None
 
-        # 1.1) fail when add-on is too old
+        # 1.1) Fail when add-on is too old.
         # This is a temporary 2.8x migration check, so we can manage addons that are supported.
 
         if mod.bl_info.get("blender", (0, 0, 0)) < (2, 80, 0):
             if _bpy.app.debug:
-                print(f"Warning: Add-on '{module_name:s}' has not been upgraded to 2.8, ignoring")
+                print(f"Warning: Add-on '{module_name:s}' was not upgraded for 2.80, ignoring")
             return None
 
-        # 2) try register collected modules
-        # removed, addons need to handle own registration now.
+        # 2) Try register collected modules.
+        # Removed register_module, addons need to handle their own registration now.
 
         use_owner = mod.bl_info.get("use_owner", True)
         if use_owner:
@@ -379,7 +379,7 @@ def enable(module_name, *, default_set=False, persistent=False, handle_error=Non
             owner_id_prev = _bl_owner_id_get()
             _bl_owner_id_set(module_name)
 
-        # 3) try run the modules register function
+        # 3) Try run the modules register function.
         try:
             mod.register()
         except Exception as ex:
diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c
index a2c7c9099c1..b90483e89b9 100644
--- a/source/blender/python/generic/blf_py_api.c
+++ b/source/blender/python/generic/blf_py_api.c
@@ -468,7 +468,7 @@ static PyMethodDef BLF_methods[] = {
     {NULL, NULL, 0, NULL},
 };
 
-PyDoc_STRVAR(BLF_doc, "This module provides access to blenders text drawing functions.");
+PyDoc_STRVAR(BLF_doc, "This module provides access to Blender's text drawing functions.");
 static struct PyModuleDef BLF_module_def = {
     PyModuleDef_HEAD_INIT,
     "blf",       /* m_name */
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index a3dd8ef93f2..cbd57b28242 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -86,7 +86,7 @@ static PyStructSequence_Field app_info_fields[] = {
     {(char *)"version_char", (char *)"The Blender version character (for minor releases)"},
     {(char *)"version_cycle", (char *)"The release status of this build alpha/beta/rc/release"},
     {(char *)"binary_path",
-     (char *)"The location of blenders executable, useful for utilities that spawn new instances"},
+     (char *)"The location of Blender's executable, useful for utilities that open new instances"},
     {(char *)"background",
      (char *)"Boolean, True when blender is running without a user interface (started with -b)"},
     {(char *)"factory_startup",
diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c
index cb79a1f7f93..1c48dc1baae 100644
--- a/source/blender/python/intern/bpy_interface_atexit.c
+++ b/source/blender/python/intern/bpy_interface_atexit.c
@@ -17,7 +17,7 @@
 /** \file
  * \ingroup pythonintern
  *
- * This file inserts an exit callback into pythons 'atexit' module.
+ * This file inserts an exit callback into Python's 'atexit' module.
  * Without this sys.exit() can crash because blender is not properly closing
  * resources.
  */
diff --git a/source/blender/python/intern/bpy_library_load.c b/source/blender/python/intern/bpy_library_load.c
index 3de8e49dffd..5ea16c8c197 100644
--- a/source/blender/python/intern/bpy_library_load.c
+++ b/source/blender/python/intern/bpy_library_load.c
@@ -19,9 +19,9 @@
  *
  * This file exposed blend file library appending/linking to python, typically
  * this would be done via RNA api but in this case a hand written python api
- * allows us to use pythons context manager (__enter__ and __exit__).
+ * allows us to use Python's context manager (`__enter__` and `__exit__`).
  *
- * Everything here is exposed via bpy.data.libraries.load(...) which returns
+ * Everything here is exposed via `bpy.data.libraries.load(...)` which returns
  * a context manager.
  */
 
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 074d72f094f..ad7d5137ebc 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -2986,8 +2986,8 @@ PyDoc_STRVAR(
     "      .. warning::\n"
     "\n"
     "         There is a known bug with using a callback,\n"
-    "         Python must keep a reference to the strings returned or Blender will misbehave\n"
-    "         or even crash."
+    "         Python must keep a reference to the strings returned by the callback or Blender\n"
+    "         will misbehave or even crash."
     "\n"
     "   :type items: sequence of string tuples or a function\n" BPY_PROPDEF_NAME_DOC
         BPY_PROPDEF_DESC_DOC
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 8385bff0256..734e929fdf4 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -17,11 +17,11 @@
 /** \file
  * \ingroup pythonintern
  *
- * This file is the main interface between python and blenders data api (RNA),
- * exposing RNA to python so blender data can be accessed in a python like way.
+ * This file is the main interface between Python and Blender's data api (RNA),
+ * exposing RNA to Python so blender data can be accessed in a Python like way.
  *
- * The two main types are 'BPy_StructRNA' and 'BPy_PropertyRNA' - the base
- * classes for most of the data python accesses in blender.
+ * The two main types are #BPy_StructRNA and #BPy_PropertyRNA - the base
+ * classes for most of the data Python accesses in blender.
  */
 
 #include <Python.h>
@@ -67,10 +67,10 @@
 #include "BKE_report.h"
 #include "BKE_idprop.h"
 
-/* only for types */
+/* Only for types. */
 #include "BKE_node.h"
 
-#include "../generic/idprop_py_api.h" /* for IDprop lookups */
+#include "../generic/idprop_py_api.h" /* For IDprop lookups. */
 #include "../generic/py_capi_utils.h"
 #include "../generic/python_utildefines.h"
 
@@ -86,7 +86,7 @@ static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self);
 #define BPY_DOC_ID_PROP_TYPE_NOTE \
   "   .. note::\n" \
   "\n" \
-  "      Only :class:`bpy.types.ID`, :class:`bpy.types.Bone` and\n" \
+  "      Only the :class:`bpy.types.ID`, :class:`bpy.types.Bone` and\n" \
   "      :class:`bpy.types.PoseBone` classes support custom properties.\n"
 
 int pyrna_struct_validity_check(BPy_StructRNA *pysrna)
@@ -119,7 +119,7 @@ void pyrna_invalidate(BPy_DummyPointerRNA *self)
 #ifdef USE_PYRNA_INVALIDATE_GC
 #  define FROM_GC(g) ((PyObject *)(((PyGC_Head *)g) + 1))
 
-/* only for sizeof() */
+/* Only for sizeof(). */
 struct gc_generation {
   PyGC_Head head;
   int threshold;
@@ -131,7 +131,7 @@ static void id_release_gc(struct ID *id)
   unsigned int j;
   // unsigned int i = 0;
   for (j = 0; j < 3; j++) {
-    /* hack below to get the 2 other lists from _PyGC_generation0 that are normally not exposed */
+    /* Hack below to get the 2 other lists from _PyGC_generation0 that are normally not exposed. */
     PyGC_Head *gen = (PyGC_Head *)(((char *)_PyGC_generation0) + (sizeof(gc_generation) * j));
     PyGC_Head *g = gen->gc.gc_next;
     while ((g = g->gc.gc_next) != gen) {
@@ -159,7 +159,7 @@ static PyObject *id_free_weakref_cb(PyObject *weakinfo_pair, PyObject *weakref);
 static PyMethodDef id_free_weakref_cb_def = {
     "id_free_weakref_cb", (PyCFunction)id_free_weakref_cb, METH_O, NULL};
 
-/* adds a reference to the list, remember to decref */
+/* Adds a reference to the list, remember to decref. */
 static GHash *id_weakref_pool_get(ID *id)
 {
   GHash *weakinfo_hash = NULL;
@@ -168,13 +168,13 @@ static GHash *id_weakref_pool_get(ID *id)
     weakinfo_hash = BLI_ghash_lookup(id_weakref_pool, (void *)id);
   }
   else {
-    /* first time, allocate pool */
+    /* First time, allocate pool. */
     id_weakref_pool = BLI_ghash_ptr_new("rna_global_pool");
     weakinfo_hash = NULL;
   }
 
   if (weakinfo_hash == NULL) {
-    /* we're using a ghash as a set, could use libHX's HXMAP_SINGULAR but would be an extra dep. */
+    /* We use a ghash as a set, we could use libHX's HXMAP_SINGULAR, but would be an extra dep. */
     weakinfo_hash = BLI_ghash_ptr_new("rna_id");
     BLI_ghash_insert(id_weakref_pool, id, weakinfo_hash);
   }
@@ -182,7 +182,7 @@ static GHash *id_weakref_pool_get(ID *id)
   return weakinfo_hash;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list