[PATCH 28 of 52 Narval cube] [autopep8] E22 - Fix extraneous whitespace around keywords

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


# HG changeset patch
# User Nsukami Patrick <ptrck at nskm dot xyz>
# Date 1585460419 0
#      Sun Mar 29 05:40:19 2020 +0000
# Node ID 9a5afee96d229acbbf24f5dd38566688f97fc679
# Parent  6948c7b7d85e0caa13a36fdf5bfcc9e77de85b65
[autopep8] E22 - Fix extraneous whitespace around keywords

diff --git a/cubicweb_narval/hooks.py b/cubicweb_narval/hooks.py
--- a/cubicweb_narval/hooks.py
+++ b/cubicweb_narval/hooks.py
@@ -34,7 +34,7 @@
         cleanupdelay = self.repo.config['plan-cleanup-delay']
         if not cleanupdelay:
             return # no auto cleanup
-        cleanupinterval = min(60*60*24, cleanupdelay)
+        cleanupinterval = min(60 * 60 * 24, cleanupdelay)
         def cleanup_plans(repo, delay=timedelta(seconds=cleanupdelay),
                           now=datetime.now):
             session = repo.internal_session()
diff --git a/cubicweb_narval/logformat.py b/cubicweb_narval/logformat.py
--- a/cubicweb_narval/logformat.py
+++ b/cubicweb_narval/logformat.py
@@ -46,7 +46,7 @@
 # block. If any match is found we split the block in two.
 
 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)
+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):
@@ -114,7 +114,7 @@
         except (KeyError, ValueError):
             req.warning('badly formated log %s' % record)
             path = line = u''
-            severity     = logging.DEBUG
+            severity = logging.DEBUG
             severityname = severities[int(severity)]
             msg = record
         log_msg_id = 'log_msg_%i' % msg_idx
@@ -145,7 +145,7 @@
             snip = u'\n'.join((lines[0],
                                lines[1],
                                u'  ...',
-                               u'    %i more lines [double click to expand]' % (len(lines)-4),
+                               u'    %i more lines [double click to expand]' % (len(lines) - 4),
                                u'  ...',
                                lines[-2],
                                lines[-1]))
@@ -155,7 +155,7 @@
             )
             for div_id, content, button, h_class in divs:
                 text = _(button)
-                js   = u"toggleVisibility('%s'); toggleVisibility('%s');" % divs_id
+                js = u"toggleVisibility('%s'); toggleVisibility('%s');" % divs_id
 
                 w(u'<div id="%s" %s>' % (div_id, h_class))
                 w(u'<div class="raw_test" ondblclick="javascript: %s" '
diff --git a/cubicweb_narval/migration/4.0.0_Any.py b/cubicweb_narval/migration/4.0.0_Any.py
--- a/cubicweb_narval/migration/4.0.0_Any.py
+++ b/cubicweb_narval/migration/4.0.0_Any.py
@@ -70,7 +70,7 @@
     commit()
     # fire all necessary transitions
     print "Setting TestExecution states in correct state"
-    to_update=[]
+    to_update = []
     for (eid,) in te_eids:
         te = session.entity_from_eid(eid)
         if te.execution_status == 'ready':
@@ -122,7 +122,7 @@
                        {'data': Binary(data.encode('utf-8')), 'eid': eid})
 
             log_list.append((eid, rset[0][0]))
-            if not i%1000:
+            if not i % 1000:
                 print i, "..."
                 commit(ask_confirm=False)
                 print "OK"
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
@@ -230,7 +230,7 @@
         data can be raw if no file is provided otherwise it must be a
         dictionary, which will be appended as multipart content to the body.
         """
-        self.debug('send HTTP %s %s params=%s, data=%s'%(method.upper(), url, params, data))
+        self.debug('send HTTP %s %s params=%s, data=%s' % (method.upper(), url, params, data))
         _cw_fields = params.keys()
         if files:
             _cw_fields += files.keys()
diff --git a/cubicweb_narval/narvalbot/engine.py b/cubicweb_narval/narvalbot/engine.py
--- a/cubicweb_narval/narvalbot/engine.py
+++ b/cubicweb_narval/narvalbot/engine.py
@@ -48,7 +48,7 @@
         if record.exc_text:
             if msg[-1:] != "\n":
                 msg += "\n"
-            msg =  record.exc_text
+            msg = record.exc_text
         if isinstance(msg, unicode):
             msg = msg.encode('utf-8')
         return '%s\t%s\t%s\t%s<br/>' % (record.levelno,
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
@@ -56,7 +56,7 @@
             value = self.options.get(optname, config[optname])
             fvalue = format_option_value(optdef, value)
             if fvalue:
-                cmd.append('--'+optname)
+                cmd.append('--' + optname)
                 cmd.append(str(fvalue))
         return cmd
 
@@ -115,7 +115,7 @@
                 self.exception('error while starting process: %s', ex)
             if not queue:
                 # nothing to do, sleep a bit
-                delay =  min(float(self.config.cnx_infos[instid].get('poll-delay', 0))
+                delay = min(float(self.config.cnx_infos[instid].get('poll-delay', 0))
                              for instid in self.instance_ids) or 60
                 time.sleep(delay)
             self._wait_for_free_slot()




More information about the cubicweb-devel mailing list