diff options
author | mathieui <mathieui@mathieui.net> | 2014-03-24 23:25:06 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2014-03-24 23:25:06 +0100 |
commit | 8d4202501d68e165ef85f720e72cb83ce384eab8 (patch) | |
tree | 7145f62740f7e3176bd845a103e012d4effe4cc7 /src/tabs/basetabs.py | |
parent | 6b1e3dd4ac03b14a4af23cf3e0060f4c3d1de328 (diff) | |
download | poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.tar.gz poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.tar.bz2 poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.tar.xz poezio-8d4202501d68e165ef85f720e72cb83ce384eab8.zip |
Use RawConfigParser.get{int,bool,float} whenever possible
config.get('option', 'value').lower() == 'value' is just ugly and
stupid, especially for bool.
One if in basetabs:556 was also missing a comparison, leading to True
whenever the option was set.
Diffstat (limited to 'src/tabs/basetabs.py')
-rw-r--r-- | src/tabs/basetabs.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tabs/basetabs.py b/src/tabs/basetabs.py index 5e38775b..00f924b0 100644 --- a/src/tabs/basetabs.py +++ b/src/tabs/basetabs.py @@ -126,7 +126,7 @@ class Tab(object): Returns 1 or 0, depending on if we are using the vertical tab list or not. """ - if config.get('enable_vertical_tab_list', 'false') == 'true': + if config.get('enable_vertical_tab_list', False): return 0 return 1 @@ -556,7 +556,7 @@ class ChatTab(Tab): if not self.is_muc or self.joined: if state in ('active', 'inactive', 'gone') and self.inactive and not always_send: return - if config.get_by_tabname('send_chat_states', 'true', self.general_jid, True) and \ + if config.get_by_tabname('send_chat_states', True, self.general_jid, True) and \ self.remote_wants_chatstates is not False: msg = self.core.xmpp.make_message(self.get_dest_jid()) msg['type'] = self.message_type @@ -570,7 +570,7 @@ class ChatTab(Tab): on the the current status of the input """ name = self.general_jid - if config.get_by_tabname('send_chat_states', 'true', name, True) == 'true' and self.remote_wants_chatstates: + if config.get_by_tabname('send_chat_states', True, name, True) and self.remote_wants_chatstates: needed = 'inactive' if self.inactive else 'active' self.cancel_paused_delay() if not empty_after: @@ -585,7 +585,7 @@ class ChatTab(Tab): we create a timed event that will put us to paused in a few seconds """ - if config.get_by_tabname('send_chat_states', 'true', self.general_jid, True) != 'true': + if not config.get_by_tabname('send_chat_states', True, self.general_jid, True): return if self.timed_event_paused: # check the weakref |