[PATCH 33 of 52 Narval cube] [autopep8] E302 - Add missing 2 blank lines

Nsukami Patrick ptrck at nskm.xyz
Wed Apr 1 11:34:33 CEST 2020


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585460432 0
#      Sun Mar 29 05:40:32 2020 +0000
# Node ID 451e619d95c86851973759b57b844b6206643fc0
# Parent  d5d0a2b27b8b364e2ba0086220faec09309560df
[autopep8] E302 - Add missing 2 blank lines

diff --git a/cubicweb_narval/entities.py b/cubicweb_narval/entities.py
--- a/cubicweb_narval/entities.py
+++ b/cubicweb_narval/entities.py
@@ -107,6 +107,7 @@
         data['state'] = self.execution_status
         return data
 
+
 class NoIndexLogFileIndexableAdapter(IFTIndexableAdapter):
     __select__ = is_instance('File') & has_related_entities('execution_log', 'object')
 
diff --git a/cubicweb_narval/hooks.py b/cubicweb_narval/hooks.py
--- a/cubicweb_narval/hooks.py
+++ b/cubicweb_narval/hooks.py
@@ -59,6 +59,7 @@
             msg = self.cnx._('recipe may not be started')
             raise ValidationError(plan.eid, {None: msg})
 
+
 class BeforePlanCreated(hook.Hook):
     """a plan is about to be created, create an Operation to check it can
     actually be started
@@ -70,6 +71,7 @@
     def __call__(self):
         RunnablePlanOp(self._cw, plan=self.entity)
 
+
 class SetScriptOnPlanHook(hook.Hook):
     __regid__ = 'narval.plan.set_script'
     __select__ = hook.Hook.__select__ & hook.match_rtype('execution_of')
diff --git a/cubicweb_narval/logformat.py b/cubicweb_narval/logformat.py
--- a/cubicweb_narval/logformat.py
+++ b/cubicweb_narval/logformat.py
@@ -48,6 +48,7 @@
 GOOD_MSG_STRICT_RE = re.compile(r'^[0-9]+\t.*\t.*\t')
 GOOD_MSG_START_RE = re.compile(r'^[0-9]+\t.*\t.*\t', re.MULTILINE)
 
+
 def log_to_html(req, domid, data, w, defaultlevel='Info',
                 severities=REVERSE_SEVERITIES):
     """format logs data to an html table
@@ -62,6 +63,7 @@
     _table_header(req, domid, w)
     _main_table(req, domid, data, w, defaultlevel, severities)
 
+
 def _selector(req, domid, w, defaultlevel, severities):
     req.add_js(('cubes.narval.js', 'jquery.tablesorter.js'))
     if defaultlevel != 'Debug':
@@ -76,11 +78,13 @@
     w(u'</select>')
     w(u'</form>')
 
+
 def _table_header(req, domid, w):
     w(u'<table class="listing table table-condensed" id="%s">' % domid)
     w(u'<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>' % (
         req._('severity'), req._('path or command'), req._('line'), req._('message')))
 
+
 def _main_table(req, domid, data, w, defaultlevel, severities):
     all_msg = []
     # try to cure invalid msg:
diff --git a/cubicweb_narval/narvalbot/__init__.py b/cubicweb_narval/narvalbot/__init__.py
--- a/cubicweb_narval/narvalbot/__init__.py
+++ b/cubicweb_narval/narvalbot/__init__.py
@@ -43,6 +43,7 @@
 else:
     MODE = 'installed'
 
+
 def _find_prefix(start_path=NARVAL_SOFTWARE_ROOT):
     """Runs along the parent directories of *start_path* (default to
     narval source directory) looking for one containing a
@@ -70,9 +71,11 @@
 except KeyError:
     INSTALL_PREFIX = _find_prefix()
 
+
 class ConfigurationError(Exception):
     """a misconfiguration error"""
 
+
 def options_dict(strvalue):
     options = text_to_dict(strvalue)
     for option in (u'max-cpu-time', u'max-reprieve', u'max-time'):
@@ -83,6 +86,7 @@
                                              BYTE_UNITS)
     return options
 
+
 class NarvalConfiguration(Configuration):
     options = (
         # main options
@@ -184,6 +188,7 @@
 
 _CW_SOURCES_FILE = os.environ.get('NARVALSOURCES', _DEFAULT_SOURCES_FILE)
 
+
 def connection_infos():
     if osp.exists(_CW_SOURCES_FILE):
         config = ConfigParser()
diff --git a/cubicweb_narval/narvalbot/main.py b/cubicweb_narval/narvalbot/main.py
--- a/cubicweb_narval/narvalbot/main.py
+++ b/cubicweb_narval/narvalbot/main.py
@@ -28,6 +28,7 @@
 
 from . import NarvalConfiguration
 
+
 class StartCommand(cl.Command):
     """start the narval process master. Takes optional cubicweb instance
     identifiers from which it should load its task queue.
diff --git a/cubicweb_narval/narvalbot/server.py b/cubicweb_narval/narvalbot/server.py
--- a/cubicweb_narval/narvalbot/server.py
+++ b/cubicweb_narval/narvalbot/server.py
@@ -38,6 +38,7 @@
 
 from . import NarvalConfiguration, options_dict, main
 
+
 class NarvalTask(tasksqueue.Task):
 
     def __init__(self, instance_id, eid, priority=0, options=None):
diff --git a/cubicweb_narval/schema.py b/cubicweb_narval/schema.py
--- a/cubicweb_narval/schema.py
+++ b/cubicweb_narval/schema.py
@@ -26,6 +26,7 @@
 IMMUTABLE_ATTR_PERMS = DEFAULT_ATTRPERMS.copy()
 IMMUTABLE_ATTR_PERMS['update'] = ()
 
+
 class Recipe(EntityType):
     __permissions__ = PUB_SYSTEM_ENTITY_PERMS
     name = String(maxsize=256, unique=True, required=True,
@@ -33,10 +34,12 @@
     script = String(description=_("the recipe's script to execute"),
                     required=True)
 
+
 class granted_permission(RelationDefinition):
     subject = 'Recipe'
     object = 'CWPermission'
 
+
 class require_permission(RelationDefinition):
     subject = 'Recipe'
     object = 'CWPermission'
@@ -59,6 +62,7 @@
 
 make_workflowable(Plan, in_state_descr=_('execution status'))
 
+
 class execution_log(RelationDefinition):
     __permissions__ = {
         'read': ('managers', 'users', 'guests', 'narval'),
diff --git a/cubicweb_narval/site_cubicweb.py b/cubicweb_narval/site_cubicweb.py
--- a/cubicweb_narval/site_cubicweb.py
+++ b/cubicweb_narval/site_cubicweb.py
@@ -13,6 +13,7 @@
 
 from rql.utils import register_function, FunctionDescr
 
+
 class is_null(FunctionDescr):
     supported_backends = ('postgres', 'sqlite',)
     rtype = 'Boolean'
diff --git a/cubicweb_narval/testutils.py b/cubicweb_narval/testutils.py
--- a/cubicweb_narval/testutils.py
+++ b/cubicweb_narval/testutils.py
@@ -65,6 +65,7 @@
             pid, status = os.wait()
             self.returncode = status
 
+
 class NarvalBaseTC(CubicWebTC):
     """Narval Base class for Narval Recipe test."""
     @classmethod
diff --git a/cubicweb_narval/views/__init__.py b/cubicweb_narval/views/__init__.py
--- a/cubicweb_narval/views/__init__.py
+++ b/cubicweb_narval/views/__init__.py
@@ -3,9 +3,11 @@
 from cubicweb.web.views import uicfg
 from cubicweb_narval.logformat import log_to_html
 
+
 def no_robot_index(self):
     return [NOINDEX, NOFOLLOW]
 
+
 class FormatedLogView(EntityView):
     __select__ = EntityView.__select__ & is_instance('File')
     __regid__ = 'narval.formated_log'
diff --git a/cubicweb_narval/views/plan.py b/cubicweb_narval/views/plan.py
--- a/cubicweb_narval/views/plan.py
+++ b/cubicweb_narval/views/plan.py
@@ -57,6 +57,7 @@
             'recipe': entity.recipe.view('outofcontext')}
         self.w('<h1>%s</h1>' % title)
 
+
 class PlanConfigTab(tabs.PrimaryTab):
     __regid__ = _('narval.plan.tab_setup')
     __select__ = is_instance('Plan')
@@ -75,6 +76,7 @@
         else:
             self.w(self._cw._(entity.execution_status))
 
+
 class PlanIBreadCrumbsAdapter(ibreadcrumbs.IBreadCrumbsAdapter):
     __select__ = is_instance('Plan')
 
@@ -212,6 +214,7 @@
             'Any X,XU,XO,XP WHERE X is_instance_of Plan, X cwuri XU, X options XO, X priority XP, '
             'X in_state S, S name "ready"')])
 
+
 class FileAppendForm(forms.FieldsForm):
     __regid__ = 'narval-file-append'
 
@@ -222,6 +225,7 @@
     def get_action(self):
         return self._cw.build_url('narval-file-append')
 
+
 class FileAppendFormView(view.StartupView):
     '''
     useful for debugging, call with ?vid=narval-file-append
@@ -232,6 +236,7 @@
         form = self._cw.vreg['forms'].select('narval-file-append', self._cw)
         form.render(w=self.w)
 
+
 class FileAppendController(controller.Controller):
     __regid__ = 'narval-file-append'
 
diff --git a/cubicweb_narval/views/recipe.py b/cubicweb_narval/views/recipe.py
--- a/cubicweb_narval/views/recipe.py
+++ b/cubicweb_narval/views/recipe.py
@@ -38,6 +38,7 @@
 _pvs.tag_attribute(('Recipe', 'script'), 'hidden')
 _pvs.tag_object_of(('*', 'execution_of', 'Recipe'), 'hidden')
 
+
 class RecipePrimaryView(tabs.TabbedPrimaryView):
     __select__ = is_instance('Recipe')
 
@@ -55,6 +56,7 @@
         self._cw.add_css('pygments.css')
         super(RecipeConfigTab, self).render_entity_attributes(entity)
 
+
 class RecipeExecutionsTab(EntityView):
     __select__ = (is_instance('Recipe') &
                   has_related_entities('execution_of', 'object'))
@@ -82,6 +84,7 @@
         return 1
     return 0
 
+
 class RecipePlansSummaryTable(tableview.EntityTableView):
     __select__ = is_instance('Plan')
     __regid__ = 'narval.recipe.plans_summary'
diff --git a/cubicweb_narval/views/startup.py b/cubicweb_narval/views/startup.py
--- a/cubicweb_narval/views/startup.py
+++ b/cubicweb_narval/views/startup.py
@@ -22,6 +22,7 @@
 
 from cubicweb_narval.views import no_robot_index
 
+
 class PlanSummaryTable(tableview.EntityTableView):
     __regid__ = 'narval.plan.summarytable'
     __select__ = is_instance('Plan') | none_rset()
diff --git a/test/test_functional.py b/test/test_functional.py
--- a/test/test_functional.py
+++ b/test/test_functional.py
@@ -29,6 +29,7 @@
 test_dir = os.path.dirname(__file__)
 narvalbot._CW_SOURCES_FILE = os.path.join(test_dir, 'data', 'narval-cw-sources.ini')
 
+
 class NarvalFunctionalTC(NarvalBaseTC):
     """Test for no operation recipe"""
 
diff --git a/test/unittest_security.py b/test/unittest_security.py
--- a/test/unittest_security.py
+++ b/test/unittest_security.py
@@ -25,6 +25,7 @@
 from cubicweb import ValidationError
 from cubicweb.devtools.testlib import CubicWebTC
 
+
 class NarvalSecurityTC(CubicWebTC):
 
     def setUp(self):
diff --git a/test/unittest_views.py b/test/unittest_views.py
--- a/test/unittest_views.py
+++ b/test/unittest_views.py
@@ -28,6 +28,7 @@
 test_dir = os.path.dirname(__file__)
 narvalbot._CW_SOURCES_FILE = os.path.join(test_dir, 'data', 'narval-cw-sources.ini')
 
+
 class NarvalViewsTC(NarvalBaseTC):
     """Test for no operation recipe"""
 




More information about the cubicweb-devel mailing list