[Python-modules-commits] [python-social-auth] 53/131: PEP8

Wolfgang Borgert debacle at moszumanska.debian.org
Sat Dec 24 15:17:01 UTC 2016


This is an automated email from the git hooks/post-receive script.

debacle pushed a commit to tag v0.2.20
in repository python-social-auth.

commit a52e3d374eed220fcc846f2221ae27e09d452c8b
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date:   Sat Jun 4 22:07:19 2016 -0300

    PEP8
---
 social/backends/weixin.py | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/social/backends/weixin.py b/social/backends/weixin.py
index 0eb81e5..279a030 100644
--- a/social/backends/weixin.py
+++ b/social/backends/weixin.py
@@ -44,7 +44,9 @@ class WeixinOAuth2(BaseOAuth2):
         nickname = data.get('nickname')
         if nickname:
             # weixin api has some encode bug, here need handle
-            data['nickname'] = nickname.encode('raw_unicode_escape').decode('utf-8')
+            data['nickname'] = nickname.encode(
+                'raw_unicode_escape'
+            ).decode('utf-8')
         return data
 
     def auth_params(self, state=None):
@@ -103,9 +105,10 @@ class WeixinOAuth2(BaseOAuth2):
 
 
 class WeixinOAuth2APP(WeixinOAuth2):
-    """Weixin OAuth authentication backend
+    """
+    Weixin OAuth authentication backend
 
-        can't use in web, only in weixin app
+    Can't use in web, only in weixin app
     """
     name = 'weixinapp'
     ID_KEY = 'openid'
@@ -133,17 +136,18 @@ class WeixinOAuth2APP(WeixinOAuth2):
         params.update(self.get_scope_argument())
         params.update(self.auth_extra_arguments())
         params = urllib.urlencode(sorted(params.items()))
-        return '{}#wechat_redirect'.format(self.AUTHORIZATION_URL + '?' + params)
-
+        return '{}#wechat_redirect'.format(
+            self.AUTHORIZATION_URL + '?' + params
+        )
 
     def auth_complete_params(self, state=None):
-            appid, secret = self.get_key_and_secret()
-            return {
-                'grant_type': 'authorization_code',  # request auth code
-                'code': self.data.get('code', ''),  # server response code
-                'appid': appid,
-                'secret': secret,
-            }
+        appid, secret = self.get_key_and_secret()
+        return {
+            'grant_type': 'authorization_code',  # request auth code
+            'code': self.data.get('code', ''),  # server response code
+            'appid': appid,
+            'secret': secret,
+        }
 
     def validate_state(self):
         return None

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