3 Commits
v0.2 ... v0.2.1

Author SHA1 Message Date
Salad Dais
16c02d8b8c v0.2.1 2021-05-02 02:07:09 +00:00
Salad Dais
badd4dbc78 Call the correct module's handle_init
Forgot about late binding on closure scopes.
2021-05-02 00:01:59 +00:00
Salad Dais
a63418aaac Pin to Qt5 2021-05-01 21:52:13 +00:00
2 changed files with 12 additions and 9 deletions

View File

@@ -277,13 +277,8 @@ class AddonManager:
# Make sure module initialization happens after any pending task cancellations
# due to module unloading.
def _init_soon():
cls._call_module_hooks(mod, "handle_init", cls.SESSION_MANAGER)
if not cls._SUBPROCESS:
for session in cls.SESSION_MANAGER.sessions:
with addon_ctx.push(new_session=session):
cls._call_module_hooks(mod, "handle_session_init", session)
asyncio.get_event_loop().call_soon(_init_soon)
asyncio.get_event_loop().call_soon(cls._init_module, mod)
except Exception as e:
if had_mod:
logging.exception("Exploded trying to reload addon %s" % spec.name)
@@ -299,6 +294,14 @@ class AddonManager:
if raise_exceptions and load_exception is not None:
raise load_exception
@classmethod
def _init_module(cls, mod: ModuleType):
cls._call_module_hooks(mod, "handle_init", cls.SESSION_MANAGER)
if not cls._SUBPROCESS:
for session in cls.SESSION_MANAGER.sessions:
with addon_ctx.push(new_session=session):
cls._call_module_hooks(mod, "handle_session_init", session)
@classmethod
def _unload_module(cls, old_mod: ModuleType):
cls._call_module_hooks(old_mod, "handle_unload", cls.SESSION_MANAGER)

View File

@@ -25,7 +25,7 @@ from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
version = '0.2'
version = '0.2.1'
with open(path.join(here, 'README.md')) as readme_fh:
readme = readme_fh.read()
@@ -93,7 +93,7 @@ setup(
'Glymur<1.0',
'numpy<2.0',
# These could be in extras_require if you don't want a GUI.
'pyside2',
'pyside2<6.0',
'qasync',
],
tests_require=[