# HG changeset patch # User Christophe de Vienne # Date 1423230220 -3600 # Node ID 88f60d4b9952e3321c5ce2df26b5440fe3ca76b7 # Parent e53cc2182cf8c5a0889ec13bb6e308b0174d013b [newcube] Make the generated code PEP-8 compliant Closes #4925396 diff -r e53cc2182cf8 -r 88f60d4b9952 devtools/devctl.py --- a/devtools/devctl.py Sun Aug 31 18:04:46 2014 +0200 +++ b/devtools/devctl.py Fri Feb 06 14:43:40 2015 +0100 @@ -579,8 +579,8 @@ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # -# You should have received a copy of the GNU Lesser General Public License along -# with this program. If not, see . +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . ''', 'GPL': '''\ @@ -591,7 +591,8 @@ # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. # # You should have received a copy of the GNU General Public License along with # this program. If not, see . diff -r e53cc2182cf8 -r 88f60d4b9952 skeleton/__pkginfo__.py.tmpl --- a/skeleton/__pkginfo__.py.tmpl Sun Aug 31 18:04:46 2014 +0200 +++ b/skeleton/__pkginfo__.py.tmpl Fri Feb 06 14:43:40 2015 +0100 @@ -13,7 +13,7 @@ description = '%(shortdesc)s' web = 'http://www.cubicweb.org/project/%%s' %% distname -__depends__ = %(dependencies)s +__depends__ = %(dependencies)s __recommends__ = {} classifiers = [ @@ -29,6 +29,7 @@ THIS_CUBE_DIR = join('share', 'cubicweb', 'cubes', modname) + def listdir(dirpath): return [join(dirpath, fname) for fname in _listdir(dirpath) if fname[0] != '.' and not fname.endswith('.pyc') @@ -40,9 +41,9 @@ [THIS_CUBE_DIR, [fname for fname in glob('*.py') if fname != 'setup.py']], ] # check for possible extended cube layout -for dname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', 'wdoc', 'i18n', 'migration'): +for dname in ('entities', 'views', 'sobjects', 'hooks', 'schema', 'data', + 'wdoc', 'i18n', 'migration'): if isdir(dname): data_files.append([join(THIS_CUBE_DIR, dname), listdir(dname)]) # Note: here, you'll need to add subdirectories if you want # them to be included in the debian package - diff -r e53cc2182cf8 -r 88f60d4b9952 skeleton/migration/postcreate.py.tmpl --- a/skeleton/migration/postcreate.py.tmpl Sun Aug 31 18:04:46 2014 +0200 +++ b/skeleton/migration/postcreate.py.tmpl Fri Feb 06 14:43:40 2015 +0100 @@ -11,4 +11,3 @@ # Example of site property change #set_property('ui.site-title', "") - diff -r e53cc2182cf8 -r 88f60d4b9952 skeleton/setup.py --- a/skeleton/setup.py Sun Aug 31 18:04:46 2014 +0200 +++ b/skeleton/setup.py Fri Feb 06 14:43:40 2015 +0100 @@ -16,8 +16,8 @@ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # -# You should have received a copy of the GNU Lesser General Public License along -# with CubicWeb. If not, see . +# You should have received a copy of the GNU Lesser General Public License +# along with CubicWeb. If not, see . """Generic Setup script, takes package info from __pkginfo__.py file """ __docformat__ = "restructuredtext en" @@ -25,11 +25,11 @@ import os import sys import shutil -from os.path import isdir, exists, join, walk +from os.path import exists, join, walk try: if os.environ.get('NO_SETUPTOOLS'): - raise ImportError() # do as there is no setuptools + raise ImportError() # do as there is no setuptools from setuptools import setup from setuptools.command import install_lib USE_SETUPTOOLS = True @@ -41,7 +41,7 @@ # import required features from __pkginfo__ import modname, version, license, description, web, \ - author, author_email, classifiers + author, author_email, classifiers if exists('README'): long_description = file('README').read() @@ -52,10 +52,10 @@ import __pkginfo__ if USE_SETUPTOOLS: requires = {} - for entry in ("__depends__",): # "__recommends__"): + for entry in ("__depends__",): # "__recommends__"): requires.update(getattr(__pkginfo__, entry, {})) install_requires = [("%s %s" % (d, v and v or "")).strip() - for d, v in requires.iteritems()] + for d, v in requires.iteritems()] else: install_requires = [] @@ -82,6 +82,7 @@ scripts_ = linux_scripts return scripts_ + def export(from_dir, to_dir, blacklist=BASE_BLACKLIST, ignore_ext=IGNORED_EXTENSIONS, @@ -150,13 +151,15 @@ old_install_data.run(self) self.install_dir = _old_install_dir try: - import setuptools.command.easy_install # only if easy_install available + # only if easy_install available + import setuptools.command.easy_install # noqa # monkey patch: Crack SandboxViolation verification from setuptools.sandbox import DirectorySandbox as DS old_ok = DS._ok + def _ok(self, path): """Return True if ``path`` can be written during installation.""" - out = old_ok(self, path) # here for side effect from setuptools + out = old_ok(self, path) # here for side effect from setuptools realpath = os.path.normcase(os.path.realpath(path)) allowed_path = os.path.normcase(sys.prefix) if realpath.startswith(allowed_path): @@ -166,6 +169,7 @@ except ImportError: pass + def install(**kwargs): """setup entry point""" if USE_SETUPTOOLS: @@ -181,21 +185,22 @@ kwargs['zip_safe'] = False cmdclass['install_data'] = MyInstallData - return setup(name = distname, - version = version, - license = license, - description = description, - long_description = long_description, - author = author, - author_email = author_email, - url = web, - scripts = ensure_scripts(scripts), - data_files = data_files, - ext_modules = ext_modules, - cmdclass = cmdclass, - classifiers = classifiers, + return setup(name=distname, + version=version, + license=license, + description=description, + long_description=long_description, + author=author, + author_email=author_email, + url=web, + scripts=ensure_scripts(scripts), + data_files=data_files, + ext_modules=ext_modules, + cmdclass=cmdclass, + classifiers=classifiers, **kwargs ) -if __name__ == '__main__' : + +if __name__ == '__main__': install() diff -r e53cc2182cf8 -r 88f60d4b9952 skeleton/test/pytestconf.py --- a/skeleton/test/pytestconf.py Sun Aug 31 18:04:46 2014 +0200 +++ b/skeleton/test/pytestconf.py Fri Feb 06 14:43:40 2015 +0100 @@ -13,8 +13,8 @@ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # -# You should have received a copy of the GNU Lesser General Public License along -# with CubicWeb. If not, see . +# You should have received a copy of the GNU Lesser General Public License +# along with CubicWeb. If not, see . """ """ @@ -23,6 +23,7 @@ from logilab.common.pytest import PyTester + def getlogin(): """avoid usinng os.getlogin() because of strange tty / stdin problems (man 3 getlogin) diff -r e53cc2182cf8 -r 88f60d4b9952 skeleton/test/realdb_test_CUBENAME.py --- a/skeleton/test/realdb_test_CUBENAME.py Sun Aug 31 18:04:46 2014 +0200 +++ b/skeleton/test/realdb_test_CUBENAME.py Fri Feb 06 14:43:40 2015 +0100 @@ -13,14 +13,15 @@ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # details. # -# You should have received a copy of the GNU Lesser General Public License along -# with CubicWeb. If not, see . +# You should have received a copy of the GNU Lesser General Public License +# along with CubicWeb. If not, see . """ """ from cubicweb.devtools.testlib import CubicWebTC from cubicweb.devtools.realdbtest import buildconfig, loadconfig + def setUpModule(options): if options.source: configcls = loadconfig(options.source) @@ -28,13 +29,13 @@ raise Exception('either or options are required') else: configcls = buildconfig(options.dbuser, options.dbpassword, - options.dbname, options.euser, - options.epassword) + options.dbname, + options.euser, options.epassword) RealDatabaseTC.configcls = configcls class RealDatabaseTC(CubicWebTC): - configcls = None # set by setUpModule() + configcls = None # set by setUpModule() def test_all_primaries(self): for rset in self.iter_individual_rsets(limit=50): diff -r e53cc2182cf8 -r 88f60d4b9952 skeleton/test/test_CUBENAME.py.tmpl --- a/skeleton/test/test_CUBENAME.py.tmpl Sun Aug 31 18:04:46 2014 +0200 +++ b/skeleton/test/test_CUBENAME.py.tmpl Fri Feb 06 14:43:40 2015 +0100 @@ -27,6 +27,7 @@ from cubicweb.devtools import testlib + class DefaultTC(testlib.CubicWebTC): def test_something(self): self.skipTest('this cube has no test')