11 Commits

6 changed files with 41 additions and 18 deletions
+4 -1
View File
@@ -15,4 +15,7 @@
url = https://git.thewisewolf.dev/HoloTech/psqlmapper.git url = https://git.thewisewolf.dev/HoloTech/psqlmapper.git
[submodule "src/modules/profiles"] [submodule "src/modules/profiles"]
path = src/modules/profiles path = src/modules/profiles
url = git@thewisewolf.dev:HoloTech/profiles-plugin.git url = https://git.thewisewolf.dev/HoloTech/profiles-plugin.git
[submodule "src/modules/pluscampaign"]
path = src/modules/pluscampaign
url = https://git.thewisewolf.dev/CarmiCoven/pluscampaign-plugin.git
+18
View File
@@ -18,6 +18,24 @@ BEGIN
RETURN NEW; RETURN NEW;
END; END;
$$ language 'plpgsql'; $$ language 'plpgsql';
CREATE OR REPLACE FUNCTION current_module_version(module_name TEXT)
RETURNS INTEGER
AS $$
SELECT
to_version
FROM version_history
WHERE
component = $1
ORDER BY _timestamp DESC
LIMIT 1;
$$ LANGUAGE SQL;
CREATE TABLE app_config(
appname TEXT PRIMARY KEY,
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
-- }}} -- }}}
-- App metadata {{{ -- App metadata {{{
+2 -1
View File
@@ -6,7 +6,8 @@ active = [
".voicefix", ".voicefix",
".messagelogger", ".messagelogger",
".voicelog", ".voicelog",
".yarn" ".yarn",
".pluscampaign",
] ]
+11 -11
View File
@@ -56,7 +56,7 @@ class LeoUI(View):
Currently exposes a hidden attribute of the underlying View. Currently exposes a hidden attribute of the underlying View.
May be reimplemented in future. May be reimplemented in future.
""" """
return self._View__stopped return self._BaseView__stopped
def to_components(self) -> List[Dict[str, Any]]: def to_components(self) -> List[Dict[str, Any]]:
""" """
@@ -138,7 +138,7 @@ class LeoUI(View):
to include a pre_timeout task to include a pre_timeout task
which may optionally refresh and hence cancel the timeout. which may optionally refresh and hence cancel the timeout.
""" """
if self._View__stopped.done(): if self._BaseView__stopped.done():
# We are already stopped, nothing to do # We are already stopped, nothing to do
return return
@@ -160,17 +160,17 @@ class LeoUI(View):
# The timeout was removed entirely, silently walk away # The timeout was removed entirely, silently walk away
return return
if self._View__stopped.done(): if self._BaseView__stopped.done():
# We stopped while waiting for the pre timeout. # We stopped while waiting for the pre timeout.
# Or maybe another thread timed us out # Or maybe another thread timed us out
# Either way, we are done here # Either way, we are done here
return return
now = time.monotonic() now = time.monotonic()
if self._View__timeout_expiry is not None and now < self._View__timeout_expiry: if self._BaseView__timeout_expiry is not None and now < self._BaseView__timeout_expiry:
# The timeout was extended, make sure the timeout task is running then fade away # The timeout was extended, make sure the timeout task is running then fade away
if self._View__timeout_task is None or self._View__timeout_task.done(): if self._BaseView__timeout_task is None or self._BaseView__timeout_task.done():
self._View__timeout_task = asyncio.create_task(self._View__timeout_task_impl()) self._BaseView__timeout_task = asyncio.create_task(self._BaseView__timeout_task_impl())
else: else:
# Actually timeout, and call the post-timeout task for cleanup. # Actually timeout, and call the post-timeout task for cleanup.
self._really_timeout() self._really_timeout()
@@ -189,14 +189,14 @@ class LeoUI(View):
This copies View._dispatch_timeout, apart from the `on_timeout` dispatch, This copies View._dispatch_timeout, apart from the `on_timeout` dispatch,
which is now handled by `__dispatch_timeout`. which is now handled by `__dispatch_timeout`.
""" """
if self._View__stopped.done(): if self._BaseView__stopped.done():
return return
if self._View__cancel_callback: if self._BaseView__cancel_callback:
self._View__cancel_callback(self) self._BaseView__cancel_callback(self)
self._View__cancel_callback = None self._BaseView__cancel_callback = None
self._View__stopped.set_result(True) self._BaseView__stopped.set_result(True)
def _dispatch_item(self, *args, **kwargs): def _dispatch_item(self, *args, **kwargs):
"""Extending event dispatch to run in the instantiation context.""" """Extending event dispatch to run in the instantiation context."""