Fix T61455: Import any add-on broken

recent split userpref.py out of wm.py (rB9ec944bbab7a) forgot to move
'module_filesystem_remove' there as well...
This commit is contained in:
2019-02-12 13:32:39 +01:00
parent 20f78dc12f
commit 87c4f30954
2 changed files with 14 additions and 14 deletions

View File

@@ -36,6 +36,20 @@ from bpy.props import (
from bpy.app.translations import pgettext_tip as tip_
def module_filesystem_remove(path_base, module_name):
import os
module_name = os.path.splitext(module_name)[0]
for f in os.listdir(path_base):
f_base = os.path.splitext(f)[0]
if f_base == module_name:
f_full = os.path.join(path_base, f)
if os.path.isdir(f_full):
os.rmdir(f_full)
else:
os.remove(f_full)
class WM_OT_keyconfig_activate(Operator):
bl_idname = "wm.keyconfig_activate"
bl_label = "Activate Keyconfig"

View File

@@ -144,20 +144,6 @@ def execute_context_assign(self, context):
return operator_path_undo_return(context, data_path)
def module_filesystem_remove(path_base, module_name):
import os
module_name = os.path.splitext(module_name)[0]
for f in os.listdir(path_base):
f_base = os.path.splitext(f)[0]
if f_base == module_name:
f_full = os.path.join(path_base, f)
if os.path.isdir(f_full):
os.rmdir(f_full)
else:
os.remove(f_full)
class WM_OT_context_set_boolean(Operator):
"""Set a context value"""
bl_idname = "wm.context_set_boolean"