diff --git a/docs/source/genapi.py b/docs/source/genapi.py
index d0214c13..2fa6acda 100755
--- a/docs/source/genapi.py
+++ b/docs/source/genapi.py
@@ -20,7 +20,7 @@ def genapi():
subs = set()
for f in files:
- if not '.' in f:
+ if '.' not in f:
continue
f, ext = f.rsplit('.', 1)
diff --git a/modules/audioaddict/module.py b/modules/audioaddict/module.py
index 46515c4d..e3a3522b 100644
--- a/modules/audioaddict/module.py
+++ b/modules/audioaddict/module.py
@@ -33,7 +33,7 @@ __all__ = ['AudioAddictModule']
#
# WARNING
#
-# AudioAddict playlists do not seem to be appreciated by mplayer
+# AudioAddict playlists do not seem to be appreciated by mplayer
# VLC plays them successfully, therefore I advice to set the media_player
# option to another player in the ~/.config/weboob/radioob config file:
# [ROOT]
@@ -160,7 +160,7 @@ class AudioAddictModule(Module, CapRadio, CapCollection):
streamName = self._get_stream_name(selectedNetwork, quality)
if not self.RADIOS:
self.RADIOS = {}
- if not selectedNetwork in self.RADIOS:
+ if selectedNetwork not in self.RADIOS:
document = self.browser.location('http://listen.%s/%s' %
(self.NETWORKS[selectedNetwork]['domain'],
streamName))
@@ -199,7 +199,7 @@ class AudioAddictModule(Module, CapRadio, CapCollection):
def get_current(self, network, radio):
channel = {}
- if not network in self.HISTORY:
+ if network not in self.HISTORY:
self._get_tracks_history(network)
channel = self.HISTORY[network].get(str(self.RADIOS[network][radio]['id']))
else:
@@ -229,7 +229,7 @@ class AudioAddictModule(Module, CapRadio, CapCollection):
self._fetch_radio_list(network)
- if not radioName in self.RADIOS[network]:
+ if radioName not in self.RADIOS[network]:
return None
radio_dict = self.RADIOS[network][radioName]
diff --git a/modules/aum/module.py b/modules/aum/module.py
index 32b1546e..b5ce0528 100644
--- a/modules/aum/module.py
+++ b/modules/aum/module.py
@@ -196,7 +196,7 @@ class AuMModule(Module, CapMessages, CapMessagesPost, CapDating, CapChat, CapCon
flags |= Message.IS_UNREAD
if get_profiles:
- if not mail['from'] in contacts:
+ if mail['from'] not in contacts:
try:
with self.browser:
contacts[mail['from']] = self.get_contact(mail['from'])
@@ -329,7 +329,7 @@ class AuMModule(Module, CapMessages, CapMessagesPost, CapDating, CapChat, CapCon
def _get_slut(self, id):
id = int(id)
sluts = self.storage.get('sluts')
- if not sluts or not id in sluts:
+ if not sluts or id not in sluts:
slut = {'lastmsg': datetime.datetime(1970,1,1),
'status': None}
else:
diff --git a/modules/axabanque/pages.py b/modules/axabanque/pages.py
index 5d7ef9f5..a1e8fd47 100644
--- a/modules/axabanque/pages.py
+++ b/modules/axabanque/pages.py
@@ -128,7 +128,7 @@ class AccountsPage(BasePage):
continue
self.logger.debug('Args: %r' % args)
- if not 'paramNumCompte' in args:
+ if 'paramNumCompte' not in args:
try:
label = unicode(table.xpath('./caption')[0].text.strip())
except Exception:
diff --git a/modules/banqueaccord/pages.py b/modules/banqueaccord/pages.py
index b91d848d..eea392d5 100644
--- a/modules/banqueaccord/pages.py
+++ b/modules/banqueaccord/pages.py
@@ -171,7 +171,7 @@ class AccountsPage(LoggedPage, HTMLPage):
continue
if len(left.xpath('./span[@class="precision"]')) == 0 or \
- (left.text is None or not 'total' in left.text.lower()):
+ (left.text is None or 'total' not in left.text.lower()):
continue
balance -= CleanDecimal('.', replace_dots=False)(right)
diff --git a/modules/banquepopulaire/pages.py b/modules/banquepopulaire/pages.py
index 6627aa1a..9fbbf5f0 100644
--- a/modules/banquepopulaire/pages.py
+++ b/modules/banquepopulaire/pages.py
@@ -266,13 +266,13 @@ class AccountsPage(BasePage):
currency = Account.get_currency(m.group(1))
for tr in div.getnext().xpath('.//tbody/tr'):
- if not 'id' in tr.attrib:
+ if 'id' not in tr.attrib:
continue
args = dict(parse_qsl(tr.attrib['id']))
tds = tr.findall('td')
- if len(tds) < 4 or not 'identifiant' in args:
+ if len(tds) < 4 or 'identifiant' not in args:
self.logger.warning('Unable to parse an account')
continue
diff --git a/modules/barclays/pages.py b/modules/barclays/pages.py
index 3707981e..4e65c5f7 100644
--- a/modules/barclays/pages.py
+++ b/modules/barclays/pages.py
@@ -104,7 +104,7 @@ class AccountsPage(Page):
text = script.text
if text is None:
continue
- if not 'remotePerso' in text:
+ if 'remotePerso' not in text:
continue
account = None
diff --git a/modules/bred/pages.py b/modules/bred/pages.py
index 52c13c69..6703675d 100644
--- a/modules/bred/pages.py
+++ b/modules/bred/pages.py
@@ -153,7 +153,7 @@ class AccountsPage(BredBasePage):
if a is None:
for a in cols[0].xpath('.//li/a'):
args = self.js2args(a.attrib['href'])
- if not 'numero_compte' in args or not 'numero_poste' in args:
+ if 'numero_compte' not in args or 'numero_poste' not in args:
self.logger.warning('Card link with strange args: %s' % args)
continue
@@ -168,7 +168,7 @@ class AccountsPage(BredBasePage):
args = self.js2args(a.attrib['href'])
- if not 'numero_compte' in args or not 'numero_poste' in args:
+ if 'numero_compte' not in args or 'numero_poste' not in args:
self.logger.warning('Account link for %r with strange args: %s' % (a.attrib.get('alt', a.text), args))
continue
diff --git a/modules/canalplus/pages.py b/modules/canalplus/pages.py
index 8230030f..98eb21dc 100644
--- a/modules/canalplus/pages.py
+++ b/modules/canalplus/pages.py
@@ -117,6 +117,6 @@ class VideoPage(Page):
def get_video(self, video):
_id = self.group_dict['id']
for vid in self.document.getchildren():
- if not _id in vid.find('ID').text:
+ if _id not in vid.find('ID').text:
continue
return self.parse_video(vid, video)
diff --git a/modules/canaltp/browser.py b/modules/canaltp/browser.py
index b4287132..1b022891 100644
--- a/modules/canaltp/browser.py
+++ b/modules/canaltp/browser.py
@@ -51,7 +51,7 @@ class CanalTP(Browser):
result = result
departure = ''
for line in result.split('&'):
- if not '=' in line:
+ if '=' not in line:
raise BrokenPageError('Unable to parse result: %s' % line)
key, value = line.split('=', 1)
if key == 'nomgare':
diff --git a/modules/cic/pages.py b/modules/cic/pages.py
index 6d89d29c..e08754f9 100644
--- a/modules/cic/pages.py
+++ b/modules/cic/pages.py
@@ -93,7 +93,7 @@ class AccountsPage(Page):
url = urlparse(link)
p = parse_qs(url.query)
- if not 'rib' in p:
+ if 'rib' not in p:
continue
for i in (2,1):
diff --git a/modules/cragr/mobile/browser.py b/modules/cragr/mobile/browser.py
index 7a526943..3a104919 100644
--- a/modules/cragr/mobile/browser.py
+++ b/modules/cragr/mobile/browser.py
@@ -208,11 +208,11 @@ class CragrMobile(Browser):
target_accounts = self.page.get_transfer_target_accounts()
# check that the given source account can be used
- if not account in source_accounts.values():
+ if account not in source_accounts.values():
raise TransferError('You cannot use account %s as a source account.' % account)
# check that the given source account can be used
- if not to in target_accounts.values():
+ if to not in target_accounts.values():
raise TransferError('You cannot use account %s as a target account.' % to)
# separate euros from cents
diff --git a/modules/cragr/mobile/pages/accounts_list.py b/modules/cragr/mobile/pages/accounts_list.py
index 3c17be86..bdabe6df 100644
--- a/modules/cragr/mobile/pages/accounts_list.py
+++ b/modules/cragr/mobile/pages/accounts_list.py
@@ -109,7 +109,7 @@ class AccountsList(CragrBasePage):
elif self.look_like_account_name(token):
required_tokens['account_name'] = token
elif self.look_like_account_owner(token):
- if 'account_owner' in optional_tokens and not 'account_name' in required_tokens:
+ if 'account_owner' in optional_tokens and 'account_name' not in required_tokens:
required_tokens['account_name'] = optional_tokens['account_owner']
optional_tokens['account_owner'] = token
# Step 3: create account objects
diff --git a/modules/creditdunord/pages.py b/modules/creditdunord/pages.py
index 25406eb7..a7c3130e 100644
--- a/modules/creditdunord/pages.py
+++ b/modules/creditdunord/pages.py
@@ -296,7 +296,7 @@ class ProTransactionsPage(TransactionsPage):
for i, key, value in re.findall('listeopecv\[(\d+)\]\[\'(\w+)\'\]="(.*)";', txt):
i = int(i)
- if not i in transactions:
+ if i not in transactions:
transactions[i] = {}
transactions[i][key] = value
diff --git a/modules/creditmutuel/browser.py b/modules/creditmutuel/browser.py
index 03d1c2c0..95841add 100644
--- a/modules/creditmutuel/browser.py
+++ b/modules/creditmutuel/browser.py
@@ -177,7 +177,7 @@ class CreditMutuelBrowser(LoginBrowser):
# look for the known "everything went well" message
content = page.response.text
transfer_ok_message = u'Votre virement a été exécuté ce jour'
- if not transfer_ok_message in content:
+ if transfer_ok_message not in content:
raise TransferError('The expected message "%s" was not found.' % transfer_ok_message)
# We now have to return a Transfer object
diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py
index a94731cf..ed957f5a 100644
--- a/modules/creditmutuel/pages.py
+++ b/modules/creditmutuel/pages.py
@@ -124,7 +124,7 @@ class AccountsPage(LoggedPage, HTMLPage):
url = urlparse(link)
p = parse_qs(url.query)
- if not 'rib' in p:
+ if 'rib' not in p:
raise SkipItem()
balance = CleanDecimal('./td[2] | ./td[3]', replace_dots=True)(self)
diff --git a/modules/dlfp/module.py b/modules/dlfp/module.py
index 13e32a7d..5ea2a67d 100644
--- a/modules/dlfp/module.py
+++ b/modules/dlfp/module.py
@@ -119,7 +119,7 @@ class DLFPModule(Module, CapMessages, CapMessagesPost, CapContent):
thread = Thread(content.id)
flags = Message.IS_HTML
- if not thread.id in self.storage.get('seen', default={}):
+ if thread.id not in self.storage.get('seen', default={}):
flags |= Message.IS_UNREAD
thread.title = content.title
@@ -148,7 +148,7 @@ class DLFPModule(Module, CapMessages, CapMessagesPost, CapContent):
Insert 'com' comment and its children in the parent message.
"""
flags = Message.IS_HTML
- if not com.id in self.storage.get('seen', parent.thread.id, 'comments', default=[]):
+ if com.id not in self.storage.get('seen', parent.thread.id, 'comments', default=[]):
flags |= Message.IS_UNREAD
if getseen or flags & Message.IS_UNREAD:
diff --git a/modules/feedly/module.py b/modules/feedly/module.py
index 7e28b01a..532e97d2 100644
--- a/modules/feedly/module.py
+++ b/modules/feedly/module.py
@@ -76,7 +76,7 @@ class FeedlyModule(Module, CapMessages, CapCollection):
if entry is None:
return None
- if not thread.id in self.storage.get('seen', default=[]):
+ if thread.id not in self.storage.get('seen', default=[]):
entry.flags = Message.IS_UNREAD
entry.thread = thread
diff --git a/modules/fourchan/module.py b/modules/fourchan/module.py
index 60e1cf1d..4ed1fe9d 100644
--- a/modules/fourchan/module.py
+++ b/modules/fourchan/module.py
@@ -18,8 +18,6 @@
# along with weboob. If not, see
Link %s
%s" % (entry.link, entry.content[0]) diff --git a/modules/nolifetv/module.py b/modules/nolifetv/module.py index c02798ff..2ef7e782 100644 --- a/modules/nolifetv/module.py +++ b/modules/nolifetv/module.py @@ -128,6 +128,6 @@ class NolifeTVModule(Module, CapVideo, CapCollection): 'quality=%s&a=UEM%%7CSEM%%7CMEM%%7CCH%%7CSWQ&skey=%s&id%%5Fnlshow=%s×tamp=%s' % (quality, skey, id, timestamp)) values = dict([urllib.splitvalue(s) for s in data.split('&')]) - if not 'url' in values: + if 'url' not in values: return None return unicode(values['url']) diff --git a/modules/nolifetv/pages.py b/modules/nolifetv/pages.py index e722a1e7..cb8d1a52 100644 --- a/modules/nolifetv/pages.py +++ b/modules/nolifetv/pages.py @@ -92,7 +92,7 @@ class FamilyPage(Page): subs = list() for el in self.document.xpath('//ul/li[@data-role="list-divider"]'): - if not el.text in subs: + if el.text not in subs: yield Collection([el.text], unicode(el.text)) subs.append(el.text) diff --git a/modules/nova/module.py b/modules/nova/module.py index a58e9d30..e4674c20 100644 --- a/modules/nova/module.py +++ b/modules/nova/module.py @@ -63,7 +63,7 @@ class NovaModule(Module, CapRadio, CapCollection): if not isinstance(radio, Radio): radio = Radio(radio) - if not radio.id in self._RADIOS: + if radio.id not in self._RADIOS: return None title, description, url = self._RADIOS[radio.id] diff --git a/modules/okc/module.py b/modules/okc/module.py index c0872435..06798b81 100644 --- a/modules/okc/module.py +++ b/modules/okc/module.py @@ -169,7 +169,7 @@ class OkCModule(Module, CapMessages, CapContact, CapMessagesPost, CapDating): flags |= Message.IS_UNREAD if get_profiles: - if not mail['id_from'] in contacts: + if mail['id_from'] not in contacts: with self.browser: contacts[mail['id_from']] = self.get_contact(mail['id_from']) @@ -219,7 +219,7 @@ class OkCModule(Module, CapMessages, CapContact, CapMessagesPost, CapDating): def _get_slut(self, id): sluts = self.storage.get('sluts') - if not sluts or not id in sluts: + if not sluts or id not in sluts: slut = {'lastmsg': datetime.datetime(1970,1,1)} else: slut = self.storage.get('sluts', id) diff --git a/modules/okc/pages.py b/modules/okc/pages.py index 946a8f99..905ec494 100644 --- a/modules/okc/pages.py +++ b/modules/okc/pages.py @@ -163,7 +163,7 @@ class ProfilePage(Page): if 'looking for' in label: for i, li in enumerate(val.xpath('.//li')): profile['data']['look_for'].value['look_for_%s' % i] = ProfileNode('look_for_%s' % i, '', li.text.strip()) - elif 'summary' in label and not 'summary' in profile: + elif 'summary' in label and 'summary' not in profile: profile['summary'] = txt else: key = label.replace(' ', '_') diff --git a/modules/ouifm/module.py b/modules/ouifm/module.py index 4124da88..e7ff1b78 100644 --- a/modules/ouifm/module.py +++ b/modules/ouifm/module.py @@ -79,7 +79,7 @@ class OuiFMModule(Module, CapRadio, CapCollection): if not isinstance(radio, Radio): radio = Radio(radio) - if not radio.id in self._RADIOS: + if radio.id not in self._RADIOS: return None title, description, url, bitrate = self._RADIOS[radio.id] diff --git a/modules/quvi/module.py b/modules/quvi/module.py index 41d5dc0f..c7561a09 100644 --- a/modules/quvi/module.py +++ b/modules/quvi/module.py @@ -104,7 +104,7 @@ class QuviVideo(BaseVideo): if _id.startswith('http'): return _id - if not '.' in _id: + if '.' not in _id: raise UserError('Please give an ID in form WEBSITE.ID (for example youtube.BaW_jenozKc). Supported websites are: %s' % ', '.join(cls.BACKENDS.keys())) sub_backend, sub_id = _id.split('.', 1) diff --git a/modules/redmine/pages/issues.py b/modules/redmine/pages/issues.py index 30cd0f87..c446a556 100644 --- a/modules/redmine/pages/issues.py +++ b/modules/redmine/pages/issues.py @@ -160,7 +160,7 @@ class IssuesPage(BaseIssuePage): def get_values(key): values = [] - if not key in args: + if key not in args: return values for key, value in args[key]['values']: if value.isdigit(): @@ -394,7 +394,7 @@ class IssuePage(NewIssuePage): # check issue 666 on symlink.me i = 0 alist = author.findall('a') - if not 'title' in alist[i].attrib: + if 'title' not in alist[i].attrib: params['author'] = (int(alist[i].attrib['href'].split('/')[-1]), to_unicode(alist[i].text)) i += 1 diff --git a/modules/seloger/module.py b/modules/seloger/module.py index 2912158f..0426e31f 100644 --- a/modules/seloger/module.py +++ b/modules/seloger/module.py @@ -64,7 +64,7 @@ class SeLogerModule(Module, CapHousing): if categories['label'] != 'Villes': continue for city in categories['values']: - if not 'value' in city: + if 'value' not in city: continue c = City(city['value']) c.name = unicode(city['label']) diff --git a/modules/societegenerale/pages/accounts_list.py b/modules/societegenerale/pages/accounts_list.py index 93bf698e..470e545e 100644 --- a/modules/societegenerale/pages/accounts_list.py +++ b/modules/societegenerale/pages/accounts_list.py @@ -52,7 +52,7 @@ class AccountsList(BasePage): def get_list(self): for tr in self.document.getiterator('tr'): - if not 'LGNTableRow' in tr.attrib.get('class', '').split(): + if 'LGNTableRow' not in tr.attrib.get('class', '').split(): continue account = Account() diff --git a/modules/tinder/browser.py b/modules/tinder/browser.py index 5dc4f86c..2a9436e8 100644 --- a/modules/tinder/browser.py +++ b/modules/tinder/browser.py @@ -45,7 +45,7 @@ class FacebookBrowser(DomainBrowser): form['pass'] = password form['persistent'] = 1 form.submit(allow_redirects=False) - if not 'Location' in self.response.headers: + if 'Location' not in self.response.headers: raise BrowserIncorrectPassword() self.location(self.response.headers['Location']) diff --git a/modules/voyagessncf/module.py b/modules/voyagessncf/module.py index 53d00ac3..0e139f45 100644 --- a/modules/voyagessncf/module.py +++ b/modules/voyagessncf/module.py @@ -90,7 +90,7 @@ class VoyagesSNCFModule(Module, CapTravel): yield Station(_id, unicode(name)) # ...then ones whose name contains pattern. for _id, name in enumerate(self.STATIONS): - if pattern in name.lower() and not _id in already: + if pattern in name.lower() and _id not in already: yield Station(_id, unicode(name)) def iter_station_departures(self, station_id, arrival_id=None, date=None): diff --git a/modules/wordreference/module.py b/modules/wordreference/module.py index 5fe316d9..80709b94 100644 --- a/modules/wordreference/module.py +++ b/modules/wordreference/module.py @@ -43,10 +43,10 @@ class WordReferenceModule(Module, CapTranslate): } def translate(self, lan_from, lan_to, text): - if not lan_from in self.WRLANGUAGE.keys(): + if lan_from not in self.WRLANGUAGE.keys(): raise LanguageNotSupported() - if not lan_to in self.WRLANGUAGE.keys(): + if lan_to not in self.WRLANGUAGE.keys(): raise LanguageNotSupported() translation = Translation(0) diff --git a/weboob/applications/havedate/havedate.py b/weboob/applications/havedate/havedate.py index c90e321b..f74936c3 100644 --- a/weboob/applications/havedate/havedate.py +++ b/weboob/applications/havedate/havedate.py @@ -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 diff --git a/weboob/applications/qflatboob/main_window.py b/weboob/applications/qflatboob/main_window.py index deb2c53e..f87b2513 100644 --- a/weboob/applications/qflatboob/main_window.py +++ b/weboob/applications/qflatboob/main_window.py @@ -49,7 +49,7 @@ class HousingListWidgetItem(QListWidgetItem): text += u'