[Python-modules-commits] [python-social-auth] 13/322: PEP8
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:12:42 UTC 2016
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to tag v0.2.10
in repository python-social-auth.
commit 47042e73119c3ef753ad275f9fd923b52732efa3
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date: Sat Nov 1 22:30:41 2014 -0200
PEP8
---
social/backends/facebook.py | 2 +-
social/backends/flickr.py | 2 +-
social/backends/google.py | 2 +-
social/backends/persona.py | 2 +-
social/backends/vk.py | 4 ++--
social/backends/weibo.py | 2 +-
social/pipeline/utils.py | 2 +-
social/strategies/base.py | 2 --
social/tests/backends/legacy.py | 5 ++---
social/tests/backends/test_vk.py | 2 +-
social/tests/pipeline.py | 2 ++
11 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/social/backends/facebook.py b/social/backends/facebook.py
index 0da7223..f318169 100644
--- a/social/backends/facebook.py
+++ b/social/backends/facebook.py
@@ -129,7 +129,7 @@ class FacebookAppOAuth2(FacebookOAuth2):
if 'signed_request' in self.data:
key, secret = self.get_key_and_secret()
response = self.load_signed_request(self.data['signed_request'])
- if not 'user_id' in response and not 'oauth_token' in response:
+ if 'user_id' not in response and 'oauth_token' not in response:
raise AuthException(self)
if response is not None:
diff --git a/social/backends/flickr.py b/social/backends/flickr.py
index 453ee69..b688beb 100644
--- a/social/backends/flickr.py
+++ b/social/backends/flickr.py
@@ -38,6 +38,6 @@ class FlickrOAuth(BaseOAuth1):
def auth_extra_arguments(self):
params = super(FlickrOAuth, self).auth_extra_arguments() or {}
- if not 'perms' in params:
+ if 'perms' not in params:
params['perms'] = 'read'
return params
diff --git a/social/backends/google.py b/social/backends/google.py
index e16ad04..2536152 100644
--- a/social/backends/google.py
+++ b/social/backends/google.py
@@ -136,7 +136,7 @@ class GooglePlusAuth(BaseGoogleOAuth2API, BaseOAuth2):
return params
def auth_complete(self, *args, **kwargs):
- if 'access_token' in self.data and not 'code' in self.data:
+ if 'access_token' in self.data and 'code' not in self.data:
raise AuthMissingParameter(self, 'access_token or code')
# Token won't be available in plain server-side workflow
diff --git a/social/backends/persona.py b/social/backends/persona.py
index 0bafa63..060715c 100644
--- a/social/backends/persona.py
+++ b/social/backends/persona.py
@@ -35,7 +35,7 @@ class PersonaAuth(BaseAuth):
def auth_complete(self, *args, **kwargs):
"""Completes loging process, must return user instance"""
- if not 'assertion' in self.data:
+ if 'assertion' not in self.data:
raise AuthMissingParameter(self, 'assertion')
response = self.get_json('https://browserid.org/verify', data={
diff --git a/social/backends/vk.py b/social/backends/vk.py
index e729268..1b567bf 100644
--- a/social/backends/vk.py
+++ b/social/backends/vk.py
@@ -190,9 +190,9 @@ def vk_api(backend, method, data):
"""
# We need to perform server-side call if no access_token
data['v'] = backend.setting('API_VERSION', '3.0')
- if not 'access_token' in data:
+ if 'access_token' not in data:
key, secret = backend.get_key_and_secret()
- if not 'api_id' in data:
+ if 'api_id' not in data:
data['api_id'] = key
data['method'] = method
diff --git a/social/backends/weibo.py b/social/backends/weibo.py
index b779520..6082ae9 100644
--- a/social/backends/weibo.py
+++ b/social/backends/weibo.py
@@ -1,4 +1,4 @@
-#coding:utf8
+# coding:utf8
# author:hepochen at gmail.com https://github.com/hepochen
"""
Weibo OAuth2 backend, docs at:
diff --git a/social/pipeline/utils.py b/social/pipeline/utils.py
index 76b8e5d..b171309 100644
--- a/social/pipeline/utils.py
+++ b/social/pipeline/utils.py
@@ -22,7 +22,7 @@ def partial_to_session(strategy, next, backend, request=None, *args, **kwargs):
'uid': social.uid
} or None
}
-
+
kwargs.update(clean_kwargs)
# Clean any MergeDict data type from the values
diff --git a/social/strategies/base.py b/social/strategies/base.py
index e7e4d4d..f2273b9 100644
--- a/social/strategies/base.py
+++ b/social/strategies/base.py
@@ -2,8 +2,6 @@ import time
import random
import hashlib
-import six
-
from social.utils import setting_name, module_member
from social.store import OpenIdStore, OpenIdSessionWrapper
from social.pipeline import DEFAULT_AUTH_PIPELINE, DEFAULT_DISCONNECT_PIPELINE
diff --git a/social/tests/backends/legacy.py b/social/tests/backends/legacy.py
index a39079d..3e0947d 100644
--- a/social/tests/backends/legacy.py
+++ b/social/tests/backends/legacy.py
@@ -14,9 +14,8 @@ class BaseLegacyTest(BaseBackendTest):
super(BaseLegacyTest, self).setUp()
self.strategy.set_settings({
'SOCIAL_AUTH_{0}_FORM_URL'.format(self.name):
- self.strategy.build_absolute_uri(
- '/login/{0}'.format(self.backend.name)
- )
+ self.strategy.build_absolute_uri('/login/{0}'.format(
+ self.backend.name))
})
def extra_settings(self):
diff --git a/social/tests/backends/test_vk.py b/social/tests/backends/test_vk.py
index 1966ddd..5a2a9ac 100644
--- a/social/tests/backends/test_vk.py
+++ b/social/tests/backends/test_vk.py
@@ -1,4 +1,4 @@
-#coding: utf-8
+# coding: utf-8
from __future__ import unicode_literals
import json
diff --git a/social/tests/pipeline.py b/social/tests/pipeline.py
index 133fc3c..b52fdba 100644
--- a/social/tests/pipeline.py
+++ b/social/tests/pipeline.py
@@ -27,6 +27,7 @@ def set_slug(strategy, user, *args, **kwargs):
def remove_user(strategy, user, *args, **kwargs):
return {'user': None}
+
@partial
def set_user_from_kwargs(strategy, *args, **kwargs):
if strategy.session_get('attribute'):
@@ -34,6 +35,7 @@ def set_user_from_kwargs(strategy, *args, **kwargs):
else:
return strategy.redirect(strategy.build_absolute_uri('/attribute'))
+
@partial
def set_user_from_args(strategy, user, *args, **kwargs):
if strategy.session_get('attribute'):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git
More information about the Python-modules-commits
mailing list