summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/irc.py4
-rw-r--r--plugins/otr.py2
-rw-r--r--plugins/reminder.py4
-rw-r--r--plugins/tell.py14
-rw-r--r--poezio/config.py4
-rw-r--r--poezio/core/commands.py6
-rw-r--r--poezio/core/handlers.py2
-rw-r--r--poezio/fixes.py2
-rw-r--r--poezio/plugin_manager.py8
-rw-r--r--poezio/roster.py2
-rw-r--r--poezio/tabs/basetabs.py10
-rw-r--r--poezio/tabs/muctab.py2
-rw-r--r--poezio/tabs/rostertab.py2
-rw-r--r--test/test_completion.py2
14 files changed, 32 insertions, 32 deletions
diff --git a/plugins/irc.py b/plugins/irc.py
index 42553dee..8a9f8946 100644
--- a/plugins/irc.py
+++ b/plugins/irc.py
@@ -355,12 +355,12 @@ class Plugin(BasePlugin):
self.api.information('The current tab does not appear to be an IRC one', 'Warning')
return None
if isinstance(current, tabs.OneToOneTab):
- if not '%' in current_jid.node:
+ if '%' not in current_jid.node:
server = current_jid.node
else:
ignored, server = current_jid.node.rsplit('%', 1)
elif isinstance(current, tabs.MucTab):
- if not '%' in current_jid.node:
+ if '%' not in current_jid.node:
server = current_jid.node
else:
ignored, server = current_jid.node.rsplit('%', 1)
diff --git a/plugins/otr.py b/plugins/otr.py
index 580a72c4..2a909293 100644
--- a/plugins/otr.py
+++ b/plugins/otr.py
@@ -544,7 +544,7 @@ class Plugin(BasePlugin):
Retrieve or create an OTR context
"""
jid = safeJID(jid)
- if not jid.full in self.contexts:
+ if jid.full not in self.contexts:
flags = POLICY_FLAGS.copy()
require = self.config.get_by_tabname('require_encryption',
jid.bare, default=False)
diff --git a/plugins/reminder.py b/plugins/reminder.py
index 8fc5eb0a..b26ca4a0 100644
--- a/plugins/reminder.py
+++ b/plugins/reminder.py
@@ -118,7 +118,7 @@ class Plugin(BasePlugin):
id_ = int(arg)
except:
return
- if not id_ in self.tasks:
+ if id_ not in self.tasks:
return
self.api.information('Task %s: %s [DONE]' % (id_, self.tasks[id_][1]), 'Info')
@@ -136,7 +136,7 @@ class Plugin(BasePlugin):
self.api.information(s, 'Info')
def remind(self, id_=0):
- if not id_ in self.tasks:
+ if id_ not in self.tasks:
return
self.api.information('Task %s: %s' % (id_, self.tasks[id_][1]), 'Info')
if self.config.get('beep', '') == 'true':
diff --git a/plugins/tell.py b/plugins/tell.py
index 02a091df..04fc12cd 100644
--- a/plugins/tell.py
+++ b/plugins/tell.py
@@ -49,10 +49,10 @@ class Plugin(BasePlugin):
self.tabs = {}
def on_join(self, presence, tab):
- if not tab in self.tabs:
+ if tab not in self.tabs:
return
nick = presence['from'].resource
- if not nick in self.tabs[tab]:
+ if nick not in self.tabs[tab]:
return
for i in self.tabs[tab][nick]:
tab.command_say("%s: %s" % (nick, i))
@@ -79,9 +79,9 @@ class Plugin(BasePlugin):
return
nick, msg = args
tab = self.api.current_tab()
- if not tab in self.tabs:
+ if tab not in self.tabs:
self.tabs[tab] = {}
- if not nick in self.tabs[tab]:
+ if nick not in self.tabs[tab]:
self.tabs[tab][nick] = []
self.tabs[tab][nick].append(msg)
self.api.information('Message for %s queued' % nick, 'Info')
@@ -89,17 +89,17 @@ class Plugin(BasePlugin):
def command_untell(self, args):
"""/untell <nick>"""
tab = self.api.current_tab()
- if not tab in self.tabs:
+ if tab not in self.tabs:
return
nick = args
- if not nick in self.tabs[tab]:
+ if nick not in self.tabs[tab]:
return
del self.tabs[tab][nick]
self.api.information('Messages for %s unqueued' % nick, 'Info')
def completion_untell(self, the_input):
tab = self.api.current_tab()
- if not tab in self.tabs:
+ if tab not in self.tabs:
return Completion(the_input.auto_completion, [], '')
return Completion(the_input.auto_completion, list(self.tabs[tab]), '', quotify=False)
diff --git a/poezio/config.py b/poezio/config.py
index c68e8452..155b11ba 100644
--- a/poezio/config.py
+++ b/poezio/config.py
@@ -280,7 +280,7 @@ class Config(RawConfigParser):
else:
sections, result_lines = result
- if not section in sections:
+ if section not in sections:
result_lines.append('[%s]' % section)
result_lines.append('%s = %s' % (option, value))
else:
@@ -304,7 +304,7 @@ class Config(RawConfigParser):
else:
sections, result_lines = result
- if not section in sections:
+ if section not in sections:
log.error('Tried to remove the option %s from a non-'
'existing section (%s)', option, section)
return True
diff --git a/poezio/core/commands.py b/poezio/core/commands.py
index 65c8778f..94aad16f 100644
--- a/poezio/core/commands.py
+++ b/poezio/core/commands.py
@@ -115,7 +115,7 @@ class CommandCore:
if args is None:
return self.help('status')
- if not args[0] in POSSIBLE_SHOW.keys():
+ if args[0] not in POSSIBLE_SHOW.keys():
return self.help('status')
show = POSSIBLE_SHOW[args[0]]
@@ -562,7 +562,7 @@ class CommandCore:
if not section:
section = plugin_name
option = args[1]
- if not plugin_name in self.core.plugin_manager.plugins:
+ if plugin_name not in self.core.plugin_manager.plugins:
file_name = self.core.plugin_manager.plugins_conf_dir
file_name = os.path.join(file_name, plugin_name + '.cfg')
plugin_config = PluginConfig(file_name, plugin_name)
@@ -589,7 +589,7 @@ class CommandCore:
section = plugin_name
option = args[1]
value = args[2]
- if not plugin_name in self.core.plugin_manager.plugins:
+ if plugin_name not in self.core.plugin_manager.plugins:
file_name = self.core.plugin_manager.plugins_conf_dir
file_name = os.path.join(file_name, plugin_name + '.cfg')
plugin_config = PluginConfig(file_name, plugin_name)
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py
index 5ecb742a..e7d62567 100644
--- a/poezio/core/handlers.py
+++ b/poezio/core/handlers.py
@@ -1347,7 +1347,7 @@ class HandlerCore:
return
cert = config.get('certificate')
# update the cert representation when it uses the old one
- if cert and not ':' in cert:
+ if cert and ':' not in cert:
cert = ':'.join(i + j for i, j in zip(cert[::2], cert[1::2])).upper()
config.set_and_save('certificate', cert)
diff --git a/poezio/fixes.py b/poezio/fixes.py
index 8259f5db..1eadac12 100644
--- a/poezio/fixes.py
+++ b/poezio/fixes.py
@@ -79,7 +79,7 @@ def _filter_add_receipt_request(self, stanza):
if stanza['request_receipt']:
return stanza
- if not stanza['type'] in self.ack_types:
+ if stanza['type'] not in self.ack_types:
return stanza
if stanza['receipt']:
diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py
index f20797f0..fe4bce20 100644
--- a/poezio/plugin_manager.py
+++ b/poezio/plugin_manager.py
@@ -164,7 +164,7 @@ class PluginManager(object):
t = tab_type.__name__
if name in tab_type.plugin_commands:
return
- if not t in commands:
+ if t not in commands:
commands[t] = []
commands[t].append((name, handler, help, completion))
tab_type.plugin_commands[name] = Command(handler, help,
@@ -179,7 +179,7 @@ class PluginManager(object):
"""
commands = self.tab_commands[module_name]
t = tab_type.__name__
- if not t in commands:
+ if t not in commands:
return
for command in commands[t]:
if command[0] == name:
@@ -197,7 +197,7 @@ class PluginManager(object):
t = tab_type.__name__
if key in tab_type.plugin_keys:
return
- if not t in keys:
+ if t not in keys:
keys[t] = []
keys[t].append((key, handler))
tab_type.plugin_keys[key] = handler
@@ -211,7 +211,7 @@ class PluginManager(object):
"""
keys = self.tab_keys[module_name]
t = tab_type.__name__
- if not t in keys:
+ if t not in keys:
return
for _key in keys[t]:
if _key[0] == key:
diff --git a/poezio/roster.py b/poezio/roster.py
index 89925e07..b36442d6 100644
--- a/poezio/roster.py
+++ b/poezio/roster.py
@@ -214,7 +214,7 @@ class Roster(object):
group.remove(contact)
for group in contact.groups:
- if not group in self.groups:
+ if group not in self.groups:
self.groups[group] = RosterGroup(group, folded=group in self.folded_groups)
self.groups[group].add(contact)
diff --git a/poezio/tabs/basetabs.py b/poezio/tabs/basetabs.py
index 7d449eae..98f4c977 100644
--- a/poezio/tabs/basetabs.py
+++ b/poezio/tabs/basetabs.py
@@ -143,7 +143,7 @@ class Tab(object):
@state.setter
def state(self, value):
- if not value in STATE_COLORS:
+ if value not in STATE_COLORS:
log.debug("Invalid value for tab state: %s", value)
elif STATE_PRIORITY[value] < STATE_PRIORITY[self._state] and \
value not in ('current', 'disconnected') and \
@@ -325,12 +325,12 @@ class Tab(object):
def update_commands(self):
for c in self.plugin_commands:
- if not c in self.commands:
+ if c not in self.commands:
self.commands[c] = self.plugin_commands[c]
def update_keys(self):
for k in self.plugin_keys:
- if not k in self.key_func:
+ if k not in self.key_func:
self.key_func[k] = self.plugin_keys[k]
def on_lose_focus(self):
@@ -858,10 +858,10 @@ class OneToOneTab(ChatTab):
def _feature_correct(self, features):
"Check for the 'correction' feature"
- if not 'urn:xmpp:message-correct:0' in features:
+ if 'urn:xmpp:message-correct:0' not in features:
if 'correct' in self.commands:
del self.commands['correct']
- elif not 'correct' in self.commands:
+ elif 'correct' not in self.commands:
self.register_command('correct', self.command_correct,
desc='Fix the last message with whatever you want.',
shortdesc='Correct the last message.',
diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py
index 6349b98e..4ba6d6d0 100644
--- a/poezio/tabs/muctab.py
+++ b/poezio/tabs/muctab.py
@@ -486,7 +486,7 @@ class MucTab(ChatTab):
nick = args[0]
color = args[1].lower()
user = self.get_user_by_name(nick)
- if not color in xhtml.colors and color not in ('unset', 'random'):
+ if color not in xhtml.colors and color not in ('unset', 'random'):
return self.core.information("Unknown color: %s" % color, 'Error')
if user and user.nick == self.own_nick:
return self.core.information("You cannot change the color of your"
diff --git a/poezio/tabs/rostertab.py b/poezio/tabs/rostertab.py
index 2aa2fa5a..a8d06391 100644
--- a/poezio/tabs/rostertab.py
+++ b/poezio/tabs/rostertab.py
@@ -609,7 +609,7 @@ class RosterInfoTab(Tab):
return
else:
jid = safeJID(args[0]).bare
- if not jid in [jid for jid in roster.jids()]:
+ if jid not in [jid for jid in roster.jids()]:
self.core.information('No subscription to deny', 'Warning')
return
diff --git a/test/test_completion.py b/test/test_completion.py
index c731e807..e3d7b950 100644
--- a/test/test_completion.py
+++ b/test/test_completion.py
@@ -145,7 +145,7 @@ def test_new_completion_quoted_random(input_obj, quoted_words):
# generate the text which is supposed to be present in the input
def f(p, i):
- rep = words_l[letters[p]][i] if not ' ' in words_l[letters[p]][i] else '"'+words_l[letters[p]][i]+'"'
+ rep = words_l[letters[p]][i] if ' ' not in words_l[letters[p]][i] else '"'+words_l[letters[p]][i]+'"'
fst = letters[1] if p != 1 else rep
snd = letters[2] if p != 2 else rep
trd = letters[3] if p != 3 else rep