From 4642aa694b02fc3dc7ef0a6719f4cddffe958a75 Mon Sep 17 00:00:00 2001 From: "Schimon Jehudah, Adv." Date: Sun, 7 Jul 2024 13:31:12 +0300 Subject: [PATCH] Expose all options except 'check' and 'formatting'. --- slixfeed/config.py | 5 ++--- slixfeed/version.py | 4 ++-- slixfeed/xmpp/publish.py | 2 +- slixfeed/xmpp/status.py | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/slixfeed/config.py b/slixfeed/config.py index 9b7fb7c..fcb6c7a 100644 --- a/slixfeed/config.py +++ b/slixfeed/config.py @@ -58,12 +58,11 @@ class Config: # TODO Open SQLite file once def add_settings_jid(self, jid_bare, db_file): self.settings[jid_bare] = {} - for key in ('archive', 'enabled', 'filter', 'formatting', 'interval', - 'length', 'media', 'old', 'quantum'): + for key in self.defaults['default']: value = sqlite.get_setting_value(db_file, key) if value: self.settings[jid_bare][key] = value[0] - elif key != 'formatting': + elif key not in ('check', 'formatting'): # NOTE This might neglects the need for # self.defaults of get_setting_value self.settings[jid_bare][key] = self.defaults['default'][key] diff --git a/slixfeed/version.py b/slixfeed/version.py index 3690ca6..aa2753d 100644 --- a/slixfeed/version.py +++ b/slixfeed/version.py @@ -1,2 +1,2 @@ -__version__ = '0.1.91' -__version_info__ = (0, 1, 91) +__version__ = '0.1.92' +__version_info__ = (0, 1, 92) diff --git a/slixfeed/xmpp/publish.py b/slixfeed/xmpp/publish.py index 3a650bf..0dcff36 100644 --- a/slixfeed/xmpp/publish.py +++ b/slixfeed/xmpp/publish.py @@ -379,7 +379,7 @@ class XmppPubsubTask: async def task_publish(self, jid_bare): db_file = config.get_pathname_to_database(jid_bare) if jid_bare not in self.settings: - Config.add_settings_jid(self.settings, jid_bare, db_file) + Config.add_settings_jid(self, jid_bare, db_file) while True: await XmppPubsubAction.send_unread_items(self, jid_bare) await asyncio.sleep(60 * 180) diff --git a/slixfeed/xmpp/status.py b/slixfeed/xmpp/status.py index 497d736..995ced5 100644 --- a/slixfeed/xmpp/status.py +++ b/slixfeed/xmpp/status.py @@ -28,7 +28,7 @@ class XmppStatus: logger.debug('{}: jid: {}'.format(function_name, jid_bare)) status_text = '📜️ Slixfeed RSS News Bot' db_file = config.get_pathname_to_database(jid_bare) - enabled = Config.get_setting_value(self.settings, jid_bare, 'enabled') + enabled = Config.get_setting_value(self, jid_bare, 'enabled') if enabled: jid_task = self.pending_tasks[jid_bare] if jid_bare in self.pending_tasks else None if jid_task and len(jid_task):