[Bf-blender-cvs] [778542fd8fe] master: Cleanup: comments (long lines) in python

Campbell Barton noreply at git.blender.org
Mon Apr 29 12:02:22 CEST 2019


Commit: 778542fd8fe80f87286d36bb4005314a8343e038
Author: Campbell Barton
Date:   Mon Apr 29 19:59:13 2019 +1000
Branches: master
https://developer.blender.org/rB778542fd8fe80f87286d36bb4005314a8343e038

Cleanup: comments (long lines) in python

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

M	source/blender/python/bmesh/bmesh_py_types.c
M	source/blender/python/generic/idprop_py_api.c
M	source/blender/python/generic/py_capi_utils.c
M	source/blender/python/generic/python_utildefines.h
M	source/blender/python/gpu/gpu_py_batch.c
M	source/blender/python/intern/bpy.c
M	source/blender/python/intern/bpy_app_ocio.c
M	source/blender/python/intern/bpy_app_translations.c
M	source/blender/python/intern/bpy_driver.c
M	source/blender/python/intern/bpy_gizmo_wrap.c
M	source/blender/python/intern/bpy_interface.c
M	source/blender/python/intern/bpy_operator.c
M	source/blender/python/intern/bpy_operator_wrap.c
M	source/blender/python/intern/bpy_props.c
M	source/blender/python/intern/bpy_rna.c
M	source/blender/python/intern/bpy_rna.h
M	source/blender/python/intern/bpy_rna_array.c
M	source/blender/python/intern/bpy_rna_id_collection.c
M	source/blender/python/intern/bpy_utils_units.c
M	source/blender/python/mathutils/mathutils.c
M	source/blender/python/mathutils/mathutils_Matrix.c
M	source/blender/python/mathutils/mathutils_Vector.c
M	source/blender/python/mathutils/mathutils_geometry.c

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

diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c
index f540b2e102c..eb611e6566a 100644
--- a/source/blender/python/bmesh/bmesh_py_types.c
+++ b/source/blender/python/bmesh/bmesh_py_types.c
@@ -875,10 +875,20 @@ static PyGetSetDef bpy_bmface_getseters[] = {
 };
 
 static PyGetSetDef bpy_bmloop_getseters[] = {
-    /* generic */
-    /* flags are available but not used for loops. */
-    // {(char *)"select", (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_select_doc, (void *)BM_ELEM_SELECT},
-    // {(char *)"hide",   (getter)bpy_bm_elem_hflag_get, (setter)bpy_bm_elem_hflag_set, (char *)bpy_bm_elem_hide_doc,   (void *)BM_ELEM_HIDDEN},
+/* generic */
+/* flags are available but not used for loops. */
+#if 0
+    {(char *)"select",
+     (getter)bpy_bm_elem_hflag_get,
+     (setter)bpy_bm_elem_hflag_set,
+     (char *)bpy_bm_elem_select_doc,
+     (void *)BM_ELEM_SELECT},
+    {(char *)"hide",
+     (getter)bpy_bm_elem_hflag_get,
+     (setter)bpy_bm_elem_hflag_set,
+     (char *)bpy_bm_elem_hide_doc,
+     (void *)BM_ELEM_HIDDEN},
+#endif
     {(char *)"tag",
      (getter)bpy_bm_elem_hflag_get,
      (setter)bpy_bm_elem_hflag_set,
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index 056e3a33b6e..dd5baaa661c 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -164,7 +164,8 @@ PyObject *BPy_IDGroup_WrapData(ID *id, IDProperty *prop, IDProperty *parent)
   }
 }
 
-#if 0 /* UNUSED, currently assignment overwrites into new properties, rather than setting in-place */
+/* UNUSED, currently assignment overwrites into new properties, rather than setting in-place. */
+#if 0
 static int BPy_IDGroup_SetData(BPy_IDProperty *self, IDProperty *prop, PyObject *value)
 {
   switch (prop->type) {
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index 191863a862d..25549c95896 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -37,7 +37,8 @@
 #include "BLI_string.h"
 
 #ifndef MATH_STANDALONE
-/* only for BLI_strncpy_wchar_from_utf8, should replace with py funcs but too late in release now */
+/* Only for BLI_strncpy_wchar_from_utf8,
+ * should replace with py funcs but too late in release now. */
 #  include "BLI_string_utf8.h"
 #endif
 
@@ -273,7 +274,8 @@ void PyC_ObSpitStr(char *result, size_t result_len, PyObject *var)
     const PyTypeObject *type = Py_TYPE(var);
     PyObject *var_str = PyObject_Repr(var);
     if (var_str == NULL) {
-      /* We could print error here, but this may be used for generating errors - so don't for now. */
+      /* We could print error here,
+       * but this may be used for generating errors - so don't for now. */
       PyErr_Clear();
     }
     BLI_snprintf(result,
@@ -765,7 +767,8 @@ void PyC_MainModule_Restore(PyObject *main_mod)
   Py_XDECREF(main_mod);
 }
 
-/* must be called before Py_Initialize, expects output of BKE_appdir_folder_id(BLENDER_PYTHON, NULL) */
+/* Must be called before Py_Initialize,
+ * expects output of BKE_appdir_folder_id(BLENDER_PYTHON, NULL). */
 void PyC_SetHomePath(const char *py_path_bundle)
 {
   if (py_path_bundle == NULL) {
@@ -803,7 +806,8 @@ void PyC_SetHomePath(const char *py_path_bundle)
   {
     static wchar_t py_path_bundle_wchar[1024];
 
-    /* cant use this, on linux gives bug: #23018, TODO: try LANG="en_US.UTF-8" /usr/bin/blender, suggested 22008 */
+    /* Can't use this, on linux gives bug: #23018,
+     * TODO: try LANG="en_US.UTF-8" /usr/bin/blender, suggested 2008 */
     /* mbstowcs(py_path_bundle_wchar, py_path_bundle, FILE_MAXDIR); */
 
     BLI_strncpy_wchar_from_utf8(
diff --git a/source/blender/python/generic/python_utildefines.h b/source/blender/python/generic/python_utildefines.h
index 40cec436dea..653122c9c33 100644
--- a/source/blender/python/generic/python_utildefines.h
+++ b/source/blender/python/generic/python_utildefines.h
@@ -45,7 +45,8 @@ Py_LOCAL_INLINE(PyObject *) Py_INCREF_RET(PyObject *op)
   return op;
 }
 
-/* append & transfer ownership to the list, avoids inline Py_DECREF all over (which is quite a large macro) */
+/* Append & transfer ownership to the list,
+ * avoids inline Py_DECREF all over (which is quite a large macro). */
 Py_LOCAL_INLINE(int) PyList_APPEND(PyObject *op, PyObject *v)
 {
   int ret = PyList_Append(op, v);
diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c
index 094052b724f..a9e65413767 100644
--- a/source/blender/python/gpu/gpu_py_batch.c
+++ b/source/blender/python/gpu/gpu_py_batch.c
@@ -127,7 +127,8 @@ PyDoc_STRVAR(bpygpu_Batch_vertbuf_add_doc,
 "   Add another vertex buffer to the Batch.\n"
 "   It is not possible to add more vertices to the batch using this method.\n"
 "   Instead it can be used to add more attributes to the existing vertices.\n"
-"   A good use case would be when you have a separate vertex buffer for vertex positions and vertex normals.\n"
+"   A good use case would be when you have a separate\n"
+"   vertex buffer for vertex positions and vertex normals.\n"
 "   Current a batch can have at most " STRINGIFY(GPU_BATCH_VBO_MAX_LEN) " vertex buffers.\n"
 "\n"
 "   :param buf: The vertex buffer that will be added to the batch.\n"
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 08f4df543a8..92ba7704b19 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -177,7 +177,8 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj
     return NULL;
   }
 
-  /* same logic as BKE_appdir_folder_id_create(), but best leave it up to the script author to create */
+  /* same logic as BKE_appdir_folder_id_create(),
+   * but best leave it up to the script author to create */
   path = BKE_appdir_folder_id_user_notest(folder_id, subdir);
 
   return PyC_UnicodeFromByte(path ? path : "");
diff --git a/source/blender/python/intern/bpy_app_ocio.c b/source/blender/python/intern/bpy_app_ocio.c
index 2a56075e00e..9dcadbac2af 100644
--- a/source/blender/python/intern/bpy_app_ocio.c
+++ b/source/blender/python/intern/bpy_app_ocio.c
@@ -40,10 +40,12 @@ static PyStructSequence_Field app_ocio_info_fields[] = {
 };
 
 static PyStructSequence_Desc app_ocio_info_desc = {
-    (char *)"bpy.app.ocio", /* name */
-    (char
-         *)"This module contains information about OpenColorIO blender is linked against", /* doc */
-    app_ocio_info_fields, /* fields */
+    /* name */
+    (char *)"bpy.app.ocio",
+    /* doc */
+    (char *)"This module contains information about OpenColorIO blender is linked against",
+    /* fields */
+    app_ocio_info_fields,
     ARRAY_SIZE(app_ocio_info_fields) - 1,
 };
 
diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c
index 56de6dd1405..a48cd742448 100644
--- a/source/blender/python/intern/bpy_app_translations.c
+++ b/source/blender/python/intern/bpy_app_translations.c
@@ -47,13 +47,16 @@
 
 typedef struct {
   PyObject_HEAD
-      /* The string used to separate context from actual message in PY_TRANSLATE RNA props. */
+      /** The string used to separate context from actual message in PY_TRANSLATE RNA props. */
       const char *context_separator;
-  /* A "named tuple" (StructSequence actually...) containing all C-defined contexts. */
+  /** A "named tuple" (StructSequence actually...) containing all C-defined contexts. */
   PyObject *contexts;
-  /* A readonly mapping {C context id: python id}  (actually, a MappingProxy). */
+  /** A readonly mapping {C context id: python id}  (actually, a MappingProxy). */
   PyObject *contexts_C_to_py;
-  /* A py dict containing all registered py dicts (order is more or less random, first match wins!). */
+  /**
+   * A py dict containing all registered py dicts
+   * (order is more or less random, first match wins!).
+   */
   PyObject *py_messages;
 } BlenderAppTranslations;
 
@@ -111,8 +114,8 @@ static void _ghashutil_keyfree(void *ptr)
 /***** Python's messages cache *****/
 
 /* We cache all messages available for a given locale from all py dicts into a single ghash.
- * Changing of locale is not so common, while looking for a message translation is, so let's try to optimize
- * the later as much as we can!
+ * Changing of locale is not so common, while looking for a message translation is,
+ * so let's try to optimize the later as much as we can!
  * Note changing of locale, as well as (un)registering a message dict, invalidate that cache.
  */
 static GHash *_translations_cache = NULL;
@@ -148,7 +151,8 @@ static void _build_translations_cache(PyObject *py_messages, const char *locale)
     printf("\n");
 #  endif
 
-    /* Try to get first complete locale, then language+country, then language+variant, then only language */
+    /* Try to get first complete locale, then language+country,
+     * then language+variant, then only language. */
     lang_dict = PyDict_GetItemString(uuid_dict, locale);
     if (!lang_dict && language_country) {
       lang_dict = PyDict_GetItemString(uuid_dict, language_country);
@@ -393,8 +397,8 @@ static PyTypeObject BlenderAppTranslationsContextsType;
 static BLT_i18n_contexts_descriptor _contexts[] = BLT_I18NCONTEXTS_DESC;
 
 /* These fields are just empty placeholders, actual values get set in app_translations_struct().
- * This allows us to avoid many handwriting, and above all, to keep all context definition stuff in BLT_translation.h!
- */
+ * This allows us to avoid many handwriting, and above all,
+ * to keep all context definition stuff in BLT_translation.h! */
 static PyStructSequence_Field app_translations_contexts_fields[ARRAY_SIZE(_contexts)] = {{NULL}};
 
 static PyStructSequence_Desc app_translations_contexts_desc = {
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c
index 3457e614708..726599ff06e 100644
--- a/source/blender/python/intern/bpy_driver.c
+++ b/source/blender/python/intern/bpy_driver.c
@@ -54,7 +54,10 @@ ext

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list