Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-14 09:33:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-14 09:33:20 +0400
commit04f619d8af6ddc7de541488f77713818e18a886e (patch)
tree9c78fc1f7cb6a7bc4544bd7e1f4f2bbf39ee8752 /release
parentae6a63253499eb83f5e6c260e598e7f8fd0cae13 (diff)
- PyLineSpit() - used to print the filename and line number for internal errors now works when executing class functions in a module.
- replaced PySys_GetObject("modules") with PyImport_GetModuleDict() - use defaults for keymap import/export rather then setting the same value every time from the UI scripts.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/ui/space_userpref.py11
-rw-r--r--release/scripts/ui/space_userpref_keymap.py8
2 files changed, 8 insertions, 11 deletions
diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py
index 049d22a44ed..5f9514c5885 100644
--- a/release/scripts/ui/space_userpref.py
+++ b/release/scripts/ui/space_userpref.py
@@ -91,15 +91,12 @@ class USERPREF_HT_header(bpy.types.Header):
layout.operator_context = 'INVOKE_DEFAULT'
if userpref.active_section == 'INPUT':
- op = layout.operator("wm.keyconfig_export")
- op.filepath = "keymap.py"
- op = layout.operator("wm.keyconfig_import")
- op.filepath = "keymap.py"
+ layout.operator("wm.keyconfig_export")
+ layout.operator("wm.keyconfig_import")
elif userpref.active_section == 'ADDONS':
- op = layout.operator("wm.addon_install")
- op.filepath = "*.py"
+ layout.operator("wm.addon_install")
elif userpref.active_section == 'THEMES':
- op = layout.operator("ui.reset_default_theme")
+ layout.operator("ui.reset_default_theme")
class USERPREF_PT_tabs(bpy.types.Panel):
diff --git a/release/scripts/ui/space_userpref_keymap.py b/release/scripts/ui/space_userpref_keymap.py
index c9bae47bd39..24d77dbed32 100644
--- a/release/scripts/ui/space_userpref_keymap.py
+++ b/release/scripts/ui/space_userpref_keymap.py
@@ -513,7 +513,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
bl_idname = "wm.keyconfig_import"
bl_label = "Import Key Configuration..."
- filepath = StringProperty(name="File Path", description="Filepath to write file to")
+ filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
@@ -522,7 +522,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator):
def execute(self, context):
import shutil
- if not self.properties.filepath:
+ if not self.properties.is_property_set("filepath"):
raise Exception("Filepath not set")
f = open(self.properties.filepath, "r")
@@ -582,14 +582,14 @@ class WM_OT_keyconfig_export(bpy.types.Operator):
bl_idname = "wm.keyconfig_export"
bl_label = "Export Key Configuration..."
- filepath = StringProperty(name="File Path", description="Filepath to write file to")
+ filepath = StringProperty(name="File Path", description="Filepath to write file to", default="keymap.py")
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
kc_name = StringProperty(name="KeyConfig Name", description="Name to save the key config as")
def execute(self, context):
- if not self.properties.filepath:
+ if not self.properties.is_property_set("filepath"):
raise Exception("Filepath not set")
f = open(self.properties.filepath, "w")