]> git.parisson.com Git - django-social-auth.git/commitdiff
Small PEP8 fixes and import orders
authorMatías Aguirre <matiasaguirre@gmail.com>
Fri, 30 Dec 2011 18:50:19 +0000 (16:50 -0200)
committerMatías Aguirre <matiasaguirre@gmail.com>
Fri, 30 Dec 2011 18:50:19 +0000 (16:50 -0200)
social_auth/backends/__init__.py
social_auth/backends/contrib/dropbox.py
social_auth/backends/contrib/flickr.py
social_auth/backends/contrib/foursquare.py
social_auth/backends/contrib/github.py
social_auth/backends/contrib/livejournal.py
social_auth/backends/contrib/orkut.py
social_auth/backends/pipeline/social.py
social_auth/backends/pipeline/user.py

index e37afbbcf0369a03fbf5c691a6cbfea7221f449d..29e368b4b4a761f1a6d9b53124bfd8e95cffb659 100644 (file)
@@ -12,12 +12,9 @@ enabled.
 import logging
 logger = logging.getLogger(__name__)
 
-from os import walk
-from os.path import basename
 from urllib2 import Request, urlopen
 from urllib import urlencode
 from urlparse import urlsplit
-from collections import defaultdict
 
 from openid.consumer.consumer import Consumer, SUCCESS, CANCEL, FAILURE
 from openid.consumer.discover import DiscoveryFailure
@@ -33,7 +30,6 @@ from django.contrib.auth.backends import ModelBackend
 from django.utils import simplejson
 from django.utils.importlib import import_module
 
-from social_auth.models import UserSocialAuth
 from social_auth.utils import setting
 from social_auth.store import DjangoOpenIDStore
 from social_auth.backends.exceptions import StopPipeline
index cc26d0bfc589c1779b99e43291b71f9cd017b028..0a140fbecddef7c91627e3f890f0887a8fc29eee 100644 (file)
@@ -13,6 +13,7 @@ from django.utils import simplejson
 
 from social_auth.backends import ConsumerBasedOAuth, OAuthBackend, USERNAME
 
+
 # Dropbox configuration
 DROPBOX_SERVER = 'dropbox.com'
 DROPBOX_API = 'api.%s' % DROPBOX_SERVER
@@ -33,12 +34,13 @@ class DropboxBackend(OAuthBackend):
         return {USERNAME: response.get('uid'),
                 'email': response.get('email'),
                 'first_name': response.get('display_name')}
-    
+
     def get_user_id(self, details, response):
         """OAuth providers return an unique user id in response"""
         # Dropbox uses a uid parameter instead of id like most others...
         return response['uid']
 
+
 class DropboxAuth(ConsumerBasedOAuth):
     """Dropbox OAuth authentication mechanism"""
     AUTHORIZATION_URL = DROPBOX_AUTHORIZATION_URL
@@ -66,6 +68,7 @@ class DropboxAuth(ConsumerBasedOAuth):
                         ('DROPBOX_APP_ID',
                          'DROPBOX_API_SECRET'))
 
+
 # Backend definition
 BACKENDS = {
     'dropbox': DropboxAuth,
index e221bb426d4d9c064b9ae8efba50e35436d33889..b61db38d339a335564b9d08293bbd731693c578b 100644 (file)
@@ -16,11 +16,11 @@ except ImportError:
     from cgi import parse_qs
 
 from django.conf import settings
-from django.utils import simplejson
 
 from oauth2 import Token
 from social_auth.backends import ConsumerBasedOAuth, OAuthBackend, USERNAME
 
+
 # Flickr configuration
 FLICKR_SERVER = 'http://www.flickr.com/services'
 FLICKR_REQUEST_TOKEN_URL = '%s/oauth/request_token' % FLICKR_SERVER
index 86dc7b9182cc6cb80073b4f7686a576c79106501..d4a04f6fafc8e21a04d92d5fd982505e2012ee4d 100644 (file)
@@ -1,8 +1,7 @@
+import urllib
 import logging
 logger = logging.getLogger(__name__)
 
-import urllib
-
 from django.utils import simplejson
 
 from social_auth.backends import BaseOAuth2, OAuthBackend, USERNAME
index b24462af126b6896094618c3d0ddd875f74768fc..3b138356a59735fd2aa236ee11857f9931951e54 100644 (file)
@@ -11,11 +11,11 @@ setting, it must be a list of values to request.
 By default account id and token expiration time are stored in extra_data
 field, check OAuthBackend class for details on how to extend it.
 """
+import cgi
+import urllib
 import logging
 logger = logging.getLogger(__name__)
 
-import cgi
-import urllib
 
 from django.conf import settings
 from django.utils import simplejson
index b5ca7e03af5d4801f73791025d1439c59a0fd8c1..2e516a05048803b68014e65d92de4ac1bf284d44 100644 (file)
@@ -4,11 +4,10 @@ LiveJournal OpenID support.
 This contribution adds support for LiveJournal OpenID service in the form
 username.livejournal.com. Username is retrieved from the identity url.
 """
+import urlparse
 import logging
 logger = logging.getLogger(__name__)
 
-import urlparse
-
 from social_auth.backends import OpenIDBackend, OpenIdAuth, USERNAME
 
 
index ce3ef06b31e00334437db0637c5c585ca7fcb1ff..c426dabb10aa88dca5213d7ccfbc0311b1fd88cc 100644 (file)
@@ -10,11 +10,10 @@ can be specified by defining ORKUT_EXTRA_DATA setting.
 OAuth settings ORKUT_CONSUMER_KEY and ORKUT_CONSUMER_SECRET are needed
 to enable this service support.
 """
+import urllib
 import logging
 logger = logging.getLogger(__name__)
 
-import urllib
-
 from django.conf import settings
 from django.utils import simplejson
 
index 6b241acc932e58a049f77ed3550239c329906818..604fb8c2200e1a99cba45e53d3b72407dc7bb174 100644 (file)
@@ -1,7 +1,7 @@
 from django.conf import settings
 from django.db.utils import IntegrityError
 
-from social_auth.models import User, UserSocialAuth
+from social_auth.models import UserSocialAuth
 from social_auth.backends.pipeline import warn_setting
 
 
index af58ee3992071b47297868a73126ce15341f3a66..b1acc48824565e4aae36ae68e837631a452e35d8 100644 (file)
@@ -3,7 +3,8 @@ from uuid import uuid4
 from django.conf import settings
 
 from social_auth.models import User
-from social_auth.backends.pipeline import USERNAME, USERNAME_MAX_LENGTH, warn_setting
+from social_auth.backends.pipeline import USERNAME, USERNAME_MAX_LENGTH, \
+                                          warn_setting
 from social_auth.signals import socialauth_not_registered, \
                                 socialauth_registered, \
                                 pre_update