Flake8 cubicweb/web/webctl.py 3.26
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 22 Mar 2018 10:02:59 +0100
branch3.26
changeset 12282 61a332a50a2b
parent 12281 5cc17bac799e
child 12283 9bee3134d304
Flake8 cubicweb/web/webctl.py Having the file flake8 clean makes it easier to catch basic programming errors (e.g. name errors).
cubicweb/web/webctl.py
flake8-ok-files.txt
--- a/cubicweb/web/webctl.py	Thu Mar 22 10:04:54 2018 +0100
+++ b/cubicweb/web/webctl.py	Thu Mar 22 10:02:59 2018 +0100
@@ -20,9 +20,8 @@
 """
 from __future__ import print_function
 
-
-
-import os, os.path as osp
+import os
+import os.path as osp
 from shutil import copy, rmtree
 
 from logilab.common.shellutils import ASK
@@ -77,18 +76,19 @@
         if not dest:
             dest = osp.join(config.appdatahome, 'data')
         if osp.exists(dest):
-            if config.verbosity and (not ask_clean or
-                not (config.verbosity and
-                     ASK.confirm('Remove existing data directory %s?' % dest))):
+            if (config.verbosity
+                    and (not ask_clean
+                         or not (config.verbosity
+                                 and ASK.confirm('Remove existing data directory %s?' % dest)))):
                 raise ExecutionError('Directory %s already exists. '
                                      'Remove it first.' % dest)
             rmtreecontent(dest)
-        config.quick_start = True # notify this is not a regular start
+        config.quick_start = True  # notify this is not a regular start
         # list all resources (no matter their order)
         resources = set()
         for datadir in self._datadirs(config, repo=repo):
             for dirpath, dirnames, filenames in os.walk(datadir):
-                rel_dirpath = dirpath[len(datadir)+1:]
+                rel_dirpath = dirpath[len(datadir) + 1:]
                 resources.update(osp.join(rel_dirpath, f) for f in filenames)
 
         # locate resources and copy them to destination
--- a/flake8-ok-files.txt	Thu Mar 22 10:04:54 2018 +0100
+++ b/flake8-ok-files.txt	Thu Mar 22 10:02:59 2018 +0100
@@ -122,6 +122,7 @@
 cubicweb/web/views/staticcontrollers.py
 cubicweb/web/views/workflow.py
 cubicweb/web/views/uicfg.py
+cubicweb/web/webctl.py
 cubicweb/xy.py
 cubicweb/pyramid/auth.py
 cubicweb/pyramid/bwcompat.py