Skip to content

Commit

Permalink
clean imports & proper exception registerhandling
Browse files Browse the repository at this point in the history
  • Loading branch information
SmittyWerbenJJ committed Sep 18, 2023
1 parent 930a89a commit 253a8e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
modulesToRegister = [
HaydeeUtils, HaydeePreferences, HaydeeUI, HaydeeImporter,HaydeeExporter
]

import zipfile
def register():
"""Register addon classes."""

try:unregister()
except:pass
for cls in modulesToRegister:
try:
cls.unregister()
except:pass

for module in modulesToRegister:
module.register()
Expand All @@ -42,7 +44,7 @@ def register():

def unregister():
"""Unregister addon classes."""
for module in reversed(modulesToRegister):
for module in modulesToRegister:
module.unregister()

addon_updater_ops.unregister()

0 comments on commit 253a8e7

Please sign in to comment.