make python3.3 compatible, __class__ is no longer in the class methods namespace.
[blender.git] / release / scripts / startup / bl_ui / space_userpref_keymap.py
index e99cefb91b8c1209ba8403231b9d553a754befac..85764c5530481807d0b46e6bd60ca900487df530 100644 (file)
@@ -189,9 +189,9 @@ class InputKeyMapPanel:
         if km.is_modal:
             row.label(text="", icon='LINKED')
         if km.is_user_defined:
-            op = row.operator("wm.keymap_restore", text="Restore")
+            row.operator("wm.keymap_restore", text="Restore")
         else:
-            op = row.operator("wm.keymap_edit", text="Edit")
+            row.operator("wm.keymap_edit", text="Edit")
 
         if km.show_expanded_children:
             if children:
@@ -213,7 +213,7 @@ class InputKeyMapPanel:
                 col = self.indented_layout(col, level + 1)
                 subcol = col.split(percentage=0.2).column()
                 subcol.enabled = km.is_user_defined
-                op = subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
+                subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
 
             col.separator()
 
@@ -234,7 +234,7 @@ class InputKeyMapPanel:
         for pname, value in properties.bl_rna.properties.items():
             if pname != "rna_type" and not properties.is_property_hidden(pname):
                 if isinstance(value, bpy.types.OperatorProperties):
-                    __class__.draw_kmi_properties(box, value, title=pname)
+                    InputKeyMapPanel.draw_kmi_properties(box, value, title=pname)
                 else:
                     flow.prop(properties, pname)
 
@@ -325,7 +325,7 @@ class InputKeyMapPanel:
             # Operator properties
             props = kmi.properties
             if props is not None:
-                __class__.draw_kmi_properties(box, props)
+                InputKeyMapPanel.draw_kmi_properties(box, props)
 
             # Modal key maps attached to this operator
             if not km.is_modal:
@@ -351,9 +351,9 @@ class InputKeyMapPanel:
                 row.label()
 
                 if km.is_user_defined:
-                    op = row.operator("wm.keymap_restore", text="Restore")
+                    row.operator("wm.keymap_restore", text="Restore")
                 else:
-                    op = row.operator("wm.keymap_edit", text="Edit")
+                    row.operator("wm.keymap_edit", text="Edit")
 
                 for kmi in filtered_items:
                     self.draw_kmi(display_keymaps, kc, km, kmi, col, 1)
@@ -362,7 +362,7 @@ class InputKeyMapPanel:
                 col = self.indented_layout(layout, 1)
                 subcol = col.split(percentage=0.2).column()
                 subcol.enabled = km.is_user_defined
-                op = subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
+                subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
 
     def draw_hierarchy(self, display_keymaps, layout):
         for entry in KM_HIERARCHY:
@@ -723,9 +723,7 @@ class WM_OT_keyitem_add(bpy.types.Operator):
     bl_label = "Add Key Map Item"
 
     def execute(self, context):
-        wm = context.window_manager
         km = context.keymap
-        kc = wm.keyconfigs.default
 
         if km.is_modal:
             km.keymap_items.new_modal("", 'A', 'PRESS')  # kmi