Remove uninstall feature, as the built-in Blender remove plugin now handles this

This commit is contained in:
Dion Moult
2020-04-07 12:57:07 +10:00
parent 4c3051267e
commit 503fcee432
3 changed files with 1 additions and 42 deletions
@@ -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'}