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

@ -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

View file

@ -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