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:
parent
20f78dc12f
commit
87c4f30954
Notes:
blender-bot
2023-02-14 19:19:57 +01:00
Referenced by issue #61460, Crash: Stereoscopy + Desnoising + GPU crashes Referenced by issue blender/blender-addons#61455, Import any add-on broken on Windows 7 64-bit - module_filesystem_remove is not defined
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue