From 8d4202501d68e165ef85f720e72cb83ce384eab8 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 24 Mar 2014 23:25:06 +0100 Subject: 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. --- src/logger.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/logger.py') diff --git a/src/logger.py b/src/logger.py index 7db34932..c05cc4a6 100644 --- a/src/logger.py +++ b/src/logger.py @@ -67,7 +67,7 @@ class Logger(object): Check that the directory where we want to log the messages exists. if not, create it """ - if config.get_by_tabname('use_log', 'true', room) == 'false': + if not config.get_by_tabname('use_log', True, room): return try: makedirs(log_dir) @@ -98,7 +98,7 @@ class Logger(object): if config.get_by_tabname('load_log', 10, jid) <= 0: return - if config.get_by_tabname('use_log', 'true', jid) == 'false': + if not config.get_by_tabname('use_log', True, jid): return if nb <= 0: @@ -184,7 +184,7 @@ class Logger(object): return True jid = str(jid).replace('/', '\\') - if config.get_by_tabname('use_log', 'false', jid) != 'true': + if not config.get_by_tabname('use_log', False, jid): return True if jid in self.fds.keys(): fd = self.fds[jid] @@ -232,7 +232,7 @@ class Logger(object): """ Log a roster change """ - if config.get_by_tabname('use_log', 'false', jid) != 'true': + if not config.get_by_tabname('use_log', False, jid): return True self.check_and_create_log_dir('', open_fd=False) if not self.roster_logfile: -- cgit v1.2.3