From b53d99044fdb062e385f15bb63ad4cc8ede4c9b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 31 Aug 2022 16:00:18 +0200 Subject: [PATCH] poezio: Pass in Config object from Core MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/bookmarks.py | 4 ++-- poezio/connection.py | 4 ++-- poezio/core/core.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poezio/bookmarks.py b/poezio/bookmarks.py index ede45b2e..787f8bfe 100644 --- a/poezio/bookmarks.py +++ b/poezio/bookmarks.py @@ -44,7 +44,7 @@ from slixmpp import ( from slixmpp.exceptions import IqError, IqTimeout from slixmpp.plugins.xep_0048 import Bookmarks, Conference, URL from poezio.connection import Connection -from poezio.config import config +from poezio.config import Config log = logging.getLogger(__name__) @@ -158,7 +158,7 @@ class Bookmark: class BookmarkList: - def __init__(self): + def __init__(self, config: Config): self.config = config self.bookmarks: List[Bookmark] = [] preferred = self.config.getstr('use_bookmarks_method').lower() diff --git a/poezio/connection.py b/poezio/connection.py index da64ec02..b23e8d7d 100644 --- a/poezio/connection.py +++ b/poezio/connection.py @@ -28,7 +28,7 @@ from slixmpp.util import FileSystemCache from poezio import common from poezio import fixes from poezio.libpoezio import XDG -from poezio.config import config +from poezio.config import Config class Connection(slixmpp.ClientXMPP): @@ -38,7 +38,7 @@ class Connection(slixmpp.ClientXMPP): """ __init = False - def __init__(self, custom_version=''): + def __init__(self, config: Config, custom_version=''): self.config = config keyfile = self.config.getstr('keyfile') diff --git a/poezio/core/core.py b/poezio/core/core.py index 7035edd8..084c72f7 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -148,12 +148,12 @@ class Core: status = POSSIBLE_SHOW.get(status) or '' self.status = Status(show=status, message=self.config.getstr('status_message')) self.custom_version = custom_version - self.xmpp = connection.Connection(custom_version) + self.xmpp = connection.Connection(self.config, custom_version) self.xmpp.core = self self.keyboard = keyboard.Keyboard() roster.set_node(self.xmpp.client_roster) decorators.refresh_wrapper.core = self - self.bookmarks = BookmarkList() + self.bookmarks = BookmarkList(self.config) self.remote_fifo = None self.avatar_cache = FileSystemPerJidCache( str(XDG.cache_dir), 'avatars', binary=True)