summaryrefslogtreecommitdiff
path: root/poezio/config.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-07-02 20:59:25 +0200
committermathieui <mathieui@mathieui.net>2021-07-02 20:59:25 +0200
commit2b3cde233fec354bf1b1894e926d67ec9ce371b8 (patch)
tree89b28567bd65a4d71715ea29096855b4b8e5ea80 /poezio/config.py
parent26505c32df055bfe41c3a852fff1b1eaf5dafda7 (diff)
downloadpoezio-2b3cde233fec354bf1b1894e926d67ec9ce371b8.tar.gz
poezio-2b3cde233fec354bf1b1894e926d67ec9ce371b8.tar.bz2
poezio-2b3cde233fec354bf1b1894e926d67ec9ce371b8.tar.xz
poezio-2b3cde233fec354bf1b1894e926d67ec9ce371b8.zip
fix: improve typing
preliminary to more typing added to slixmpp, fix things in advance
Diffstat (limited to 'poezio/config.py')
-rw-r--r--poezio/config.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/poezio/config.py b/poezio/config.py
index d520ecb8..9c2201e7 100644
--- a/poezio/config.py
+++ b/poezio/config.py
@@ -249,7 +249,7 @@ class Config:
def get_by_tabname(self,
option,
- tabname: str,
+ tabname: JID,
fallback=True,
fallback_server=True,
default=''):
@@ -259,14 +259,12 @@ class Config:
in the section, we search for the global option if fallback is
True. And we return `default` as a fallback as a last resort.
"""
- if isinstance(tabname, JID):
- tabname = tabname.full
if self.default and (not default) and fallback:
default = self.default.get(DEFSECTION, {}).get(option, '')
if tabname in self.sections():
if option in self.options(tabname):
# We go the tab-specific option
- return self.get(option, default, tabname)
+ return self.get(option, default, tabname.full)
if fallback_server:
return self.get_by_servname(tabname, option, default, fallback)
if fallback: