pep8: Use "X not in Y" instead of "not X in Y"

flake8 --select E713, semi-manual fixing
This commit is contained in:
Laurent Bachelier 2014-10-11 01:27:24 +02:00
commit 21e8f82fd7
57 changed files with 81 additions and 83 deletions

View file

@ -205,7 +205,7 @@ class HaveDate(Boobmsg):
if backend_name == '*':
backend_name = None
elif backend_name is not None and not backend_name in [b.name for b in self.enabled_backends]:
elif backend_name is not None and backend_name not in [b.name for b in self.enabled_backends]:
print('Error: No such backend "%s"' % backend_name, file=self.stderr)
return 1
@ -223,13 +223,13 @@ class HaveDate(Boobmsg):
optims = {}
backends = set()
for (name, optim) in self.do('iter_optimizations', backends=backend_name):
if optims_names is not None and not name in optims_names:
if optims_names is not None and name not in optims_names:
continue
if optim.is_running():
status = 'RUNNING'
else:
status = '-------'
if not name in optims:
if name not in optims:
optims[name] = {optim.backend: status}
else:
optims[name][optim.backend] = status

View file

@ -49,7 +49,7 @@ class HousingListWidgetItem(QListWidgetItem):
text += u'<br /><font color="#008800">%s</font>' % storage.get('notes', self.housing.fullid, default='').strip().replace('\n', '<br />')
self.setText(text)
if not self.housing.fullid in storage.get('read'):
if self.housing.fullid not in storage.get('read'):
self.setBackground(QBrush(QColor(200, 200, 255)))
self.read = False
elif self.housing.fullid in storage.get('bookmarks'):

View file

@ -80,7 +80,7 @@ class MainWindow(QtMainWindow):
def tabChanged(self, i):
widget = self.ui.tabWidget.currentWidget()
if hasattr(widget, 'load') and not i in self.loaded_tabs:
if hasattr(widget, 'load') and i not in self.loaded_tabs:
widget.load()
self.loaded_tabs[i] = True

View file

@ -103,9 +103,9 @@ class Translaboob(ReplApplication):
lan_from, lan_to, text = self.parse_command_args(line, 3, 2)
try:
if not lan_from in self.LANGUAGE.keys():
if lan_from not in self.LANGUAGE.keys():
raise LanguageNotSupported()
if not lan_to in self.LANGUAGE.keys():
if lan_to not in self.LANGUAGE.keys():
raise LanguageNotSupported()
if not text or text == '-':