# HG changeset patch # User Denis Laxalde # Date 1521709379 -3600 # Node ID 61a332a50a2b469307ed77eec632d41d3240267f # Parent 5cc17bac799e31163a011c6ac41babafd6e0508b Flake8 cubicweb/web/webctl.py Having the file flake8 clean makes it easier to catch basic programming errors (e.g. name errors). diff -r 5cc17bac799e -r 61a332a50a2b cubicweb/web/webctl.py --- 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 diff -r 5cc17bac799e -r 61a332a50a2b flake8-ok-files.txt --- 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