[Bf-blender-cvs] [d3a699925d7] master: Cleanup: use 'cls' for class methods first argument

Campbell Barton noreply at git.blender.org
Mon Aug 9 07:14:27 CEST 2021


Commit: d3a699925d77809572f103853423473432d17d9b
Author: Campbell Barton
Date:   Mon Aug 9 15:03:32 2021 +1000
Branches: master
https://developer.blender.org/rBd3a699925d77809572f103853423473432d17d9b

Cleanup: use 'cls' for class methods first argument

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

M	release/scripts/modules/bl_i18n_utils/utils.py
M	release/scripts/modules/bpy_types.py
M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

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

diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py
index fda93682dc5..95184853f73 100644
--- a/release/scripts/modules/bl_i18n_utils/utils.py
+++ b/release/scripts/modules/bl_i18n_utils/utils.py
@@ -1355,7 +1355,7 @@ class I18n:
         print(prefix.join(lines))
 
     @classmethod
-    def check_py_module_has_translations(clss, src, settings=settings):
+    def check_py_module_has_translations(cls, src, settings=settings):
         """
         Check whether a given src (a py module, either a directory or a py file) has some i18n translation data,
         and returns a tuple (src_file, translations_tuple) if yes, else (None, None).
@@ -1367,11 +1367,11 @@ class I18n:
                     if not fname.endswith(".py"):
                         continue
                     path = os.path.join(root, fname)
-                    _1, txt, _2, has_trans = clss._parser_check_file(path)
+                    _1, txt, _2, has_trans = cls._parser_check_file(path)
                     if has_trans:
                         txts.append((path, txt))
         elif src.endswith(".py") and os.path.isfile(src):
-            _1, txt, _2, has_trans = clss._parser_check_file(src)
+            _1, txt, _2, has_trans = cls._parser_check_file(src)
             if has_trans:
                 txts.append((src, txt))
         for path, txt in txts:
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 29b53aedf78..d60165f760c 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -761,9 +761,9 @@ class Macro(StructRNA):
     __slots__ = ()
 
     @classmethod
-    def define(self, opname):
+    def define(cls, opname):
         from _bpy import ops
-        return ops.macro_define(self, opname)
+        return ops.macro_define(cls, opname)
 
 
 class PropertyGroup(StructRNA, metaclass=RNAMetaPropGroup):
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 46fed79332d..16b5ed33f3f 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1029,7 +1029,7 @@ class VIEW3D_PT_tools_vertexpaint_options(Panel, View3DPaintPanel):
     bl_options = {'DEFAULT_CLOSED'}
 
     @classmethod
-    def poll(self, _context):
+    def poll(cls, _context):
         # This is currently unused, since there aren't any Vertex Paint mode specific options.
         return False



More information about the Bf-blender-cvs mailing list