mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 16:46:19 +00:00
Remove uninstall feature, as the built-in Blender remove plugin now handles this
This commit is contained in:
@@ -1576,41 +1576,3 @@ class OpenUpstream(bpy.types.Operator):
|
||||
elif self.page == 'community':
|
||||
webbrowser.open('https://community.osarch.org/')
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class Uninstall(bpy.types.Operator):
|
||||
bl_idname = 'bim.uninstall'
|
||||
bl_label = 'Uninstall BlenderBIM'
|
||||
|
||||
def execute(self, context):
|
||||
import shutil
|
||||
import glob
|
||||
|
||||
cwd = os.path.dirname(os.path.realpath(__file__))
|
||||
addon_dir = os.path.join(cwd, '..')
|
||||
files = ['ifcdiff.py', 'ordered_set.py', 'pyparsing.py', 'six.py']
|
||||
directories = ['OCC', 'bcfplugin', 'dateutil', 'deepdiff',
|
||||
'elementpath', 'ifcopenshell', 'jsonpickle', 'lib', 'pystache',
|
||||
'pytz', 'svgwrite', 'xmlschema']
|
||||
|
||||
for f in files:
|
||||
path = os.path.join(addon_dir, f)
|
||||
if os.path.isfile(path):
|
||||
os.remove(path)
|
||||
|
||||
lib_dir = os.path.join(cwd, '..', 'lib')
|
||||
lib_files = glob.glob(os.path.join(lib_dir, '..', '..', '..', 'lib*.so*'))
|
||||
|
||||
for lib_file in lib_files:
|
||||
try:
|
||||
os.remove(lib_file)
|
||||
except:
|
||||
print('Error while deleting file: ', lib_file)
|
||||
shutil.rmtree(os.path.join(lib_dir, '..', '..', '..', 'oce-0.17'), ignore_errors=True)
|
||||
|
||||
for directory in directories:
|
||||
path = os.path.join(addon_dir, directory)
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
|
||||
bpy.ops.preferences.addon_remove(module='blenderbim')
|
||||
return {'FINISHED'}
|
||||
|
||||
Reference in New Issue
Block a user