[PATCH 11 of 24 Openidrelay cube] [autopep8] E302 - Add missing 2 blank lines

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 09:53:54 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585471340 0
#      Sun Mar 29 08:42:20 2020 +0000
# Node ID ef22591caf2f3e2cf645c3306a748f80d23fe120
# Parent  e9e3c7f9f532771c5eab7b314a86f6d5f63eede8
[autopep8] E302 - Add missing 2 blank lines

diff --git a/cubicweb_openidrelay/authplugin.py b/cubicweb_openidrelay/authplugin.py
--- a/cubicweb_openidrelay/authplugin.py
+++ b/cubicweb_openidrelay/authplugin.py
@@ -9,6 +9,7 @@
 from cubicweb import AuthenticationError
 from cubicweb.server.sources import native
 
+
 class OpenIDAuthentifier(native.BaseAuthentifier):
     """return CWUser eid for the given login/openid pair"""
     auth_rql = 'Any U WHERE U is CWUser, U login %(login)s, U openid %(openid)s'
diff --git a/cubicweb_openidrelay/hooks.py b/cubicweb_openidrelay/hooks.py
--- a/cubicweb_openidrelay/hooks.py
+++ b/cubicweb_openidrelay/hooks.py
@@ -23,6 +23,7 @@
 
 from cubicweb_openidrelay.authplugin import OpenIDAuthentifier
 
+
 class ServerStartupHook(hook.Hook):
     """register authentifier at startup"""
     __regid__ = 'openid-authentifier-register'
@@ -37,6 +38,7 @@
 
 OPENIDLOGGER = logging.getLogger('cubicweb.openid')
 
+
 def openidlib_logger(msg):
     OPENIDLOGGER.debug(msg)
 oidutil.log = openidlib_logger
diff --git a/cubicweb_openidrelay/schema.py b/cubicweb_openidrelay/schema.py
--- a/cubicweb_openidrelay/schema.py
+++ b/cubicweb_openidrelay/schema.py
@@ -18,6 +18,7 @@
 
 from yams.buildobjs import RelationDefinition, String
 
+
 class openid(RelationDefinition):
     subject = 'CWUser'
     object = 'String'
diff --git a/cubicweb_openidrelay/utils.py b/cubicweb_openidrelay/utils.py
--- a/cubicweb_openidrelay/utils.py
+++ b/cubicweb_openidrelay/utils.py
@@ -8,6 +8,7 @@
 from __future__ import with_statement
 import threading
 
+
 def url_args(url):
     from urllib.parse import unquote, urlsplit
     args = urlsplit(url)[3]
diff --git a/cubicweb_openidrelay/views.py b/cubicweb_openidrelay/views.py
--- a/cubicweb_openidrelay/views.py
+++ b/cubicweb_openidrelay/views.py
@@ -38,6 +38,7 @@
     ('web', 'http://schema.openid.net/contact/web/default'),
 )
 
+
 class OpenIDReqRewriter(urlrewrite.SimpleReqRewriter):
     rules = [
         ('/openid-confirm', dict(vid='openid-confirm'),)
@@ -46,6 +47,7 @@
 #uicfg.autoform_field_kwargs.tag_attribute(('CWUser', 'openid'), 'main', 'hidden')
 uicfg.primaryview_display_ctrl.tag_attribute(('CWUser', 'openid'), {'vid': 'attribute'})
 
+
 def login_now(self, login, openid):
     req = self._cw
     clear_cache(req, 'get_authorization')
@@ -60,6 +62,7 @@
         pass
     assert req.user.login == login
 
+
 class OpenIDConfirm(Controller):
     __regid__ = 'openid-confirm'
     __select__ = match_form_params('openid.assoc_handle')
@@ -106,11 +109,13 @@
                     self._cw.session.data[token] = (loginfo, identity)
                     raise Redirect(self._cw.build_url(vid='openid-createuser', __token=token))
 
+
 class OpenIDCreateUserForm(forms.FieldsForm):
     __regid__ = action = 'openid-createuser'
     form_buttons = [fw.SubmitButton(label=_('create user')),
                     fw.ResetButton(label=_('cancel'))]
 
+
 class OpenIDCreateUserController(Controller):
     __regid__ = 'openid-createuser'
 
@@ -154,12 +159,14 @@
                                          max_length=254, value=data))
         form.render(w=w)
 
+
 class yes_marker(object):
     def __bool__(self):
         return True
 
 # Negotiation
 
+
 class OpenIDRetrieverStart(authentication.WebAuthInfoRetreiver):
     """ openid authentication """
     __regid__ = 'openid-authenticate-start'
@@ -244,6 +251,7 @@
 
 # Login links
 
+
 class OpenIDLoginLink(basecomponents.HeaderComponent):
     __regid__ = 'openidlink'
     __select__ = (basecomponents.HeaderComponent.__select__ &
@@ -260,6 +268,7 @@
                 ))
         self._cw.view('openidlogform', rset=self.cw_rset, id='openidlogbox', w=w)
 
+
 class OpenIdLogForm(templates.BaseLogForm):
     __regid__ = domid = 'openidlogform'
     boxid = 'openidlogbox'
@@ -275,6 +284,7 @@
     __registry__ = 'buttons'
     __abstract__ = True
 
+
 class OpenIDButton(Button):
     __regid__ = 'openid_button'
     __abstract__ = True
@@ -287,6 +297,7 @@
 
 # XXX
 
+
 @monkeypatch(Registry)
 def selectable(self, oid, *args, **kwargs):
     """return all appobjects having the given oid that are
@@ -306,10 +317,12 @@
     label = _('google')
     url = 'https://www.google.com/accounts/o8/id'
 
+
 class YahooButton(OpenIDButton):
     label = _('yahoo')
     url = 'http://me.yahoo.com/'
 
+
 class OpenIDLogFormView(View):
     __regid__ = 'openidlogform'
     __select__ = configuration_values('auth-mode', 'cookie')
diff --git a/test/pytestconf.py b/test/pytestconf.py
--- a/test/pytestconf.py
+++ b/test/pytestconf.py
@@ -23,6 +23,7 @@
 
 from logilab.common.pytest import PyTester
 
+
 def getlogin():
     """avoid usinng os.getlogin() because of strange tty / stdin problems
     (man 3 getlogin)
diff --git a/test/test_openidrelay.py b/test/test_openidrelay.py
--- a/test/test_openidrelay.py
+++ b/test/test_openidrelay.py
@@ -40,6 +40,7 @@
 
 from cubicweb.devtools.testlib import AutomaticWebTest
 
+
 class AutomaticWebTest(AutomaticWebTest):
     '''provides `to_test_etypes` and/or `list_startup_views` implementation
     to limit test scope




More information about the cubicweb-devel mailing list