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 378fe2310915ce1455045d250c89d726f3987f00..85764c5530481807d0b46e6bd60ca900487df530 100644 (file)
@@ -138,7 +138,7 @@ class USERPREF_MT_keyconfigs(bpy.types.Menu):
         bpy.types.Menu.draw_preset(self, context)
 
 
-class InputKeyMapPanel(bpy.types.Panel):
+class InputKeyMapPanel:
     bl_space_type = 'USER_PREFERENCES'
     bl_label = "Input"
     bl_region_type = 'WINDOW'
@@ -189,9 +189,9 @@ class InputKeyMapPanel(bpy.types.Panel):
         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(bpy.types.Panel):
                 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(bpy.types.Panel):
         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(bpy.types.Panel):
             # 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(bpy.types.Panel):
                 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(bpy.types.Panel):
                 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:
@@ -411,8 +411,8 @@ def export_properties(prefix, properties, lines=None):
     if lines is None:
         lines = []
 
-    for pname in properties.keys():
-        if not properties.is_property_hidden(pname):
+    for pname in properties.bl_rna.properties.keys():
+        if pname != "rna_type" and not properties.is_property_hidden(pname):
             value = getattr(properties, pname)
             if isinstance(value, bpy.types.OperatorProperties):
                 export_properties(prefix + "." + pname, value, lines)
@@ -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