[PATCH 31 of 52 Narval cube] [autopep8] E26 - Fix spacing after comment hash for inline comments

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


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585460427 0
#      Sun Mar 29 05:40:27 2020 +0000
# Node ID ae385effadbe0979efc038c31704feaba67d60ad
# Parent  bd21d4801cfc374bd36a24548fbbe68e17518d3e
[autopep8] E26 - Fix spacing after comment hash for inline comments

diff --git a/cubicweb_narval/hooks.py b/cubicweb_narval/hooks.py
--- a/cubicweb_narval/hooks.py
+++ b/cubicweb_narval/hooks.py
@@ -33,7 +33,7 @@
     def __call__(self):
         cleanupdelay = self.repo.config['plan-cleanup-delay']
         if not cleanupdelay:
-            return # no auto cleanup
+            return  # no auto cleanup
         cleanupinterval = min(60 * 60 * 24, cleanupdelay)
         def cleanup_plans(repo, delay=timedelta(seconds=cleanupdelay),
                           now=datetime.now):
diff --git a/cubicweb_narval/logformat.py b/cubicweb_narval/logformat.py
--- a/cubicweb_narval/logformat.py
+++ b/cubicweb_narval/logformat.py
@@ -83,7 +83,7 @@
 
 def _main_table(req, domid, data, w, defaultlevel, severities):
     all_msg = []
-    #try to cure invalid msg:
+    # try to cure invalid msg:
     for msg in data.split('<br/>'):
         msg = msg.strip()
         if GOOD_MSG_STRICT_RE.search(msg) is not None:
@@ -105,7 +105,7 @@
             continue
         try:
             srecord = record.split('\t', 3)
-            if len(srecord) < 4: # some fields are missing, let's fill with ''
+            if len(srecord) < 4:  # some fields are missing, let's fill with ''
                 srec = srecord
                 srecord = [''] * 4
                 srecord[:len(srec)] = srec
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
@@ -135,7 +135,7 @@
           'group': 'daemon', 'level': 2,
           }),
         ('log-threshold',
-         {'type': 'string', # XXX use a dedicated type?
+         {'type': 'string',  # XXX use a dedicated type?
           'default': 'INFO',
           'help': 'narval bot\'s log level',
           'group': 'daemon', 'level': 1,
@@ -286,7 +286,7 @@
         data = self.http_get(url, vid='ejsonexport')
         if not len(data) == 1:
             raise Exception('expected one plan, got %s' % len(data))
-        plan = data[0] # you get a list of plan of size 1
+        plan = data[0]  # you get a list of plan of size 1
         return plan
 
 LOGGER = logging.getLogger('narval.bot')
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
@@ -24,7 +24,7 @@
 from cubicweb_narval.__pkginfo__ import version
 
 NARVAL = cl.CommandLine('narval', doc='Control Narval agents.', version=version)
-ENGINE = None # global making engine accessible **for testing purpose**
+ENGINE = None  # global making engine accessible **for testing purpose**
 
 from . import NarvalConfiguration
 
@@ -90,7 +90,7 @@
 
 for cmdcls in (StartCommand,
                RunPlanCommand,
-               #StopInstanceCommand,
+               # StopInstanceCommand,
                GenerateRCFileCommand,
                ):
     NARVAL.register(cmdcls)
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
@@ -68,10 +68,10 @@
         #args = self.config.load_command_line_configuration()
         self._quiting = None
         self._running_tasks = set()
-        self._cvar = Condition() # protect _running_tasks and signal free slot
+        self._cvar = Condition()  # protect _running_tasks and signal free slot
         # interval of time where plan queued while there is an identical plan
         # running will be ignored
-        self._skip_duplicate_time_delta = timedelta(seconds=15) # XXX
+        self._skip_duplicate_time_delta = timedelta(seconds=15)  # XXX
 
     def start(self, instance_ids=None, debug=False, pidfile=None):
         config = self.config
@@ -256,7 +256,7 @@
                 if ex.response.status_code != 409:
                     raise
         files = {'data': ('dummy', log)}
-        #an empty binary object is added automatically as "data" by create_subentity
+        # an empty binary object is added automatically as "data" by create_subentity
         data = cnxh.http_post(url, vid='create_subentity',
                               __cwetype__='File',
                               __cwrel__='reverse_execution_log',
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
@@ -24,7 +24,7 @@
 
 try:
     from cubicweb.server import SQL_CONNECT_HOOKS
-except ImportError: # no server installation
+except ImportError:  # no server installation
     pass
 else:
     def init_sqlite_connection(cnx):
diff --git a/cubicweb_narval/testutils.py b/cubicweb_narval/testutils.py
--- a/cubicweb_narval/testutils.py
+++ b/cubicweb_narval/testutils.py
@@ -61,7 +61,7 @@
                 self.returncode = -1
                 import traceback
                 traceback.print_exc(file=sys.stderr)
-        else: # parent
+        else:  # parent
             pid, status = os.wait()
             self.returncode = status
 
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
@@ -52,7 +52,7 @@
     html_headers = no_robot_index
 
     def render_entity_title(self, entity):
-        #self._cw.add_css('cubes.apycot.css')
+        # self._cw.add_css('cubes.apycot.css')
         title = self._cw._('Execution of %(recipe)s') % {
             'recipe': entity.recipe.view('outofcontext')}
         self.w('<h1>%s</h1>' % title)
@@ -250,7 +250,7 @@
             if log_file.data:
                 log_file.data.to_file(tmpfile)
             while 1:
-                if not posted['data']: # empty file
+                if not posted['data']:  # empty file
                     break
                 buf = posted['data'].read(4096)
                 if not buf:
diff --git a/test/test_functional.py b/test/test_functional.py
--- a/test/test_functional.py
+++ b/test/test_functional.py
@@ -25,7 +25,7 @@
 
 import narvalbot
 
-##override default ini file
+# override default ini file
 test_dir = os.path.dirname(__file__)
 narvalbot._CW_SOURCES_FILE = os.path.join(test_dir, 'data', 'narval-cw-sources.ini')
 
diff --git a/test/unittest_views.py b/test/unittest_views.py
--- a/test/unittest_views.py
+++ b/test/unittest_views.py
@@ -24,7 +24,7 @@
 
 import narvalbot
 
-##override default ini file
+# override default ini file
 test_dir = os.path.dirname(__file__)
 narvalbot._CW_SOURCES_FILE = os.path.join(test_dir, 'data', 'narval-cw-sources.ini')
 




More information about the cubicweb-devel mailing list