# HG changeset patch # User Sylvain Thénault # Date 1475252708 -7200 # Node ID 432f87a63057ecfb1d55edfb0c8f5951b3c9f43c # Parent d8de1ac21f36600c89244ef1aea6ef3c9e3eb0ba flake8 and all * update some copyright * drop most __docformat__ declaration * fix some flake8 warnings / errors diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/__init__.py --- a/cubicweb/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """CubicWeb is a generic framework to quickly build applications which describes relations between entitites. """ -__docformat__ = "restructuredtext en" + import imp import logging diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/_exceptions.py --- a/cubicweb/_exceptions.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/_exceptions.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Exceptions shared by different cubicweb packages.""" -__docformat__ = "restructuredtext en" + from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/appobject.py --- a/cubicweb/appobject.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/appobject.py Fri Sep 30 18:25:08 2016 +0200 @@ -27,7 +27,7 @@ common to all the application objects. """ -__docformat__ = "restructuredtext en" + from logging import getLogger diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/crypto.py --- a/cubicweb/crypto.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/crypto.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """Simple cryptographic routines, based on python-crypto.""" -__docformat__ = "restructuredtext en" + from base64 import b64encode, b64decode diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/cwconfig.py --- a/cubicweb/cwconfig.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/cwconfig.py Fri Sep 30 18:25:08 2016 +0200 @@ -179,7 +179,7 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" + import importlib import logging diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/cwctl.py --- a/cubicweb/cwctl.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/cwctl.py Fri Sep 30 18:25:08 2016 +0200 @@ -20,7 +20,7 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" + # *ctl module should limit the number of import to be imported as quickly as # possible (for cubicweb-ctl reactivity, necessary for instance for usable bash diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/cwvreg.py --- a/cubicweb/cwvreg.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/cwvreg.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -19,9 +19,6 @@ Cubicweb registries """ -__docformat__ = "restructuredtext en" -from cubicweb import _ - import sys from os.path import join, dirname, realpath from warnings import warn @@ -38,6 +35,7 @@ from rql import RQLHelper from yams.constraints import BASE_CONVERTERS +from cubicweb import _ from cubicweb import (CW_SOFTWARE_ROOT, ETYPE_NAME_MAP, CW_EVENT_MANAGER, onevent, Binary, UnknownProperty, UnknownEid) from cubicweb.predicates import appobject_selectable, _reset_is_instance_cache diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/dataimport/pgstore.py --- a/cubicweb/dataimport/pgstore.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/dataimport/pgstore.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -16,6 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """Postgres specific store""" + from __future__ import print_function import warnings @@ -24,10 +25,8 @@ from time import asctime from datetime import date, datetime, time from collections import defaultdict -from base64 import b64encode -from six import (string_types, integer_types, text_type, binary_type, - add_metaclass) +from six import string_types, integer_types, text_type, add_metaclass from six.moves import cPickle as pickle, range from logilab.common.deprecation import class_deprecated diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/devtools/__init__.py --- a/cubicweb/devtools/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/devtools/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,10 +16,9 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """Test tools for cubicweb""" + from __future__ import print_function -__docformat__ = "restructuredtext en" - import os import sys import errno diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/devtools/fake.py --- a/cubicweb/devtools/fake.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/devtools/fake.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,8 +18,6 @@ """Fake objects to ease testing of cubicweb without a fully working environment """ -__docformat__ = "restructuredtext en" - from contextlib import contextmanager from six import string_types diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/devtools/fill.py --- a/cubicweb/devtools/fill.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/devtools/fill.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ """This modules defines func / methods for creating test repositories""" from __future__ import print_function -__docformat__ = "restructuredtext en" + import logging from random import randint, choice diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/devtools/httptest.py --- a/cubicweb/devtools/httptest.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/devtools/httptest.py Fri Sep 30 18:25:08 2016 +0200 @@ -20,7 +20,7 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" + import random import threading diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/devtools/repotest.py --- a/cubicweb/devtools/repotest.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/devtools/repotest.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -21,8 +21,6 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" - from pprint import pprint from logilab.common.decorators import cachedproperty @@ -30,20 +28,23 @@ from cubicweb.devtools.testlib import RepoAccess + def tuplify(mylist): return [tuple(item) for item in mylist] + def snippet_key(a): # a[0] may be a dict or a key/value tuple return (sorted(dict(a[0]).items()), [e.expression for e in a[1]]) + def check_plan(self, rql, expected, kwargs=None): with self.session.new_cnx() as cnx: plan = self._prepare_plan(cnx, rql, kwargs) self.planner.build_plan(plan) try: self.assertEqual(len(plan.steps), len(expected), - 'expected %s steps, got %s' % (len(expected), len(plan.steps))) + 'expected %s steps, got %s' % (len(expected), len(plan.steps))) # step order is important for i, step in enumerate(plan.steps): compare_steps(self, step.test_repr(), expected[i]) @@ -51,6 +52,7 @@ pprint([step.test_repr() for step in plan.steps]) raise + def compare_steps(self, step, expected): try: self.assertEqual(step[0], expected[0], 'expected step type %s, got %s' % (expected[0], step[0])) diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/devtools/testlib.py --- a/cubicweb/devtools/testlib.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/devtools/testlib.py Fri Sep 30 18:25:08 2016 +0200 @@ -15,7 +15,8 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -"""this module contains base classes and utilities for cubicweb tests""" +"""Base classes and utilities for cubicweb tests""" + from __future__ import print_function import sys diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/entities/__init__.py --- a/cubicweb/entities/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/entities/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """base application's entities class implementation: `AnyEntity`""" -__docformat__ = "restructuredtext en" + from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/entities/adapters.py --- a/cubicweb/entities/adapters.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/entities/adapters.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2010-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2010-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/entities/authobjs.py --- a/cubicweb/entities/authobjs.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/entities/authobjs.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """entity classes user and group entities""" -__docformat__ = "restructuredtext en" + from six import string_types, text_type diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/entities/lib.py --- a/cubicweb/entities/lib.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/entities/lib.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """entity classes for optional library entities""" -__docformat__ = "restructuredtext en" + from warnings import warn from datetime import datetime diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/entities/schemaobjs.py --- a/cubicweb/entities/schemaobjs.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/entities/schemaobjs.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """schema definition related entities""" -__docformat__ = "restructuredtext en" + from logilab.common.decorators import cached diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/entities/sources.py --- a/cubicweb/entities/sources.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/entities/sources.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,8 +17,6 @@ # with CubicWeb. If not, see . """data source related entities""" -__docformat__ = "restructuredtext en" - import re from socket import gethostname import logging @@ -29,6 +27,7 @@ from cubicweb.entities import AnyEntity, fetch_config + class _CWSourceCfgMixIn(object): @property def dictconfig(self): diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/entities/test/unittest_base.py --- a/cubicweb/entities/test/unittest_base.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/entities/test/unittest_base.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# copyright 2003-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/entities/wfobjs.py --- a/cubicweb/entities/wfobjs.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/entities/wfobjs.py Fri Sep 30 18:25:08 2016 +0200 @@ -23,7 +23,7 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" + from six import text_type, string_types diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/entity.py --- a/cubicweb/entity.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/entity.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,8 +17,6 @@ # with CubicWeb. If not, see . """Base class for entity objects manipulated in clients""" -__docformat__ = "restructuredtext en" - from warnings import warn from six import text_type, string_types, integer_types @@ -47,6 +45,7 @@ _marker = object() + def greater_card(rschema, subjtypes, objtypes, index): for subjtype in subjtypes: for objtype in objtypes: diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/etwist/http.py --- a/cubicweb/etwist/http.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/etwist/http.py Fri Sep 30 18:25:08 2016 +0200 @@ -6,7 +6,7 @@ :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses """ -__docformat__ = "restructuredtext en" + class HTTPResponse(object): """An object representing an HTTP Response to be sent to the client. diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/etwist/request.py --- a/cubicweb/etwist/request.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/etwist/request.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Twisted request handler for CubicWeb""" -__docformat__ = "restructuredtext en" + from cubicweb.web.request import CubicWebRequestBase diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/etwist/server.py --- a/cubicweb/etwist/server.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/etwist/server.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """twisted server for CubicWeb web instances""" -__docformat__ = "restructuredtext en" + import sys import select diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/etwist/twconfig.py --- a/cubicweb/etwist/twconfig.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/etwist/twconfig.py Fri Sep 30 18:25:08 2016 +0200 @@ -21,7 +21,7 @@ web server integrating a repository server in the same process (only available if the repository part of the software is installed """ -__docformat__ = "restructuredtext en" + from os.path import join diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/ext/html4zope.py --- a/cubicweb/ext/html4zope.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/ext/html4zope.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,29 +1,8 @@ # Author: David Goodger -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. -# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr -# -# This file is part of CubicWeb. -# -# CubicWeb is free software: you can redistribute it and/or modify it under the -# terms of the GNU Lesser General Public License as published by the Free -# Software Foundation, either version 2.1 of the License, or (at your option) -# any later version. -# -# CubicWeb 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 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 . -""" - -""" # Contact: goodger@users.sourceforge.net # Revision: $Revision: 1.2 $ # Date: $Date: 2005-07-04 16:36:50 $ # Copyright: This module has been placed in the public domain. - """ Simple HyperText Markup Language document tree Writer. @@ -35,8 +14,6 @@ http://cvs.zope.org/Zope/lib/python/docutils/writers/Attic/html4zope.py?rev=1.1.2.2&only_with_tag=ajung-restructuredtext-integration-branch&content-type=text/vnd.viewcvs-markup """ -__docformat__ = 'reStructuredText' - import os from logilab.mtconverter import xml_escape diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/ext/rest.py --- a/cubicweb/ext/rest.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/ext/rest.py Fri Sep 30 18:25:08 2016 +0200 @@ -32,7 +32,7 @@ * `rql-table`, create a table from a RQL query """ -__docformat__ = "restructuredtext en" + import sys from itertools import chain diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/ext/tal.py --- a/cubicweb/ext/tal.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/ext/tal.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ """ -__docformat__ = "restructuredtext en" + import sys import re diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/__init__.py --- a/cubicweb/hooks/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """core hooks registering some maintainance tasks as server startup time""" -__docformat__ = "restructuredtext en" + from datetime import timedelta, datetime diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/bookmark.py --- a/cubicweb/hooks/bookmark.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/bookmark.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """bookmark related hooks""" -__docformat__ = "restructuredtext en" + from cubicweb.server import hook diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/email.py --- a/cubicweb/hooks/email.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/email.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """hooks to ensure use_email / primary_email relations consistency""" -__docformat__ = "restructuredtext en" + from cubicweb.server import hook diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/integrity.py --- a/cubicweb/hooks/integrity.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/integrity.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -19,7 +19,6 @@ validity """ -__docformat__ = "restructuredtext en" from cubicweb import _ from threading import Lock diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/logstats.py --- a/cubicweb/hooks/logstats.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/logstats.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ """looping task for dumping instance's stats in a file """ -__docformat__ = "restructuredtext en" + from datetime import datetime import json diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/metadata.py --- a/cubicweb/hooks/metadata.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/metadata.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,16 +17,12 @@ # with CubicWeb. If not, see . """Core hooks: set generic metadata""" -__docformat__ = "restructuredtext en" - from datetime import datetime -from base64 import b64encode from pytz import utc from cubicweb.predicates import is_instance from cubicweb.server import hook -from cubicweb.server.edition import EditedEntity class MetaDataHook(hook.Hook): diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/notification.py --- a/cubicweb/hooks/notification.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/notification.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """some hooks to handle notification on entity's changes""" -__docformat__ = "restructuredtext en" + from logilab.common.textutils import normalize_text from logilab.common.deprecation import deprecated diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/security.py --- a/cubicweb/hooks/security.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/security.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -19,9 +19,6 @@ the connected user """ -__docformat__ = "restructuredtext en" -from warnings import warn - from logilab.common.registry import objectify_predicate from yams import buildobjs @@ -30,13 +27,9 @@ from cubicweb.server import BEFORE_ADD_RELATIONS, ON_COMMIT_ADD_RELATIONS, hook - def check_entity_attributes(cnx, entity, action, editedattrs=None): eid = entity.eid eschema = entity.e_schema - if action == 'delete': - eschema.check_perm(session, action, eid=eid) - return # ._cw_skip_security_attributes is there to bypass security for attributes # set by hooks by modifying the entity's dictionary if editedattrs is None: diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/synccomputed.py --- a/cubicweb/hooks/synccomputed.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/synccomputed.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Hooks for synchronizing computed attributes""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from collections import defaultdict diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/syncschema.py --- a/cubicweb/hooks/syncschema.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/syncschema.py Fri Sep 30 18:25:08 2016 +0200 @@ -23,9 +23,6 @@ checking for schema consistency is done in hooks.py """ -__docformat__ = "restructuredtext en" -from cubicweb import _ - import json from copy import copy @@ -35,6 +32,7 @@ from logilab.common.decorators import clear_cache +from cubicweb import _ from cubicweb import validation_error from cubicweb.predicates import is_instance from cubicweb.schema import (SCHEMA_TYPES, META_RTYPES, VIRTUAL_RTYPES, diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/syncsession.py --- a/cubicweb/hooks/syncsession.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/syncsession.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,8 +17,6 @@ # with CubicWeb. If not, see . """Core hooks: synchronize living session on persistent data changes""" -__docformat__ = "restructuredtext en" - from cubicweb import _ from cubicweb import UnknownProperty, BadConnectionId, validation_error from cubicweb.predicates import is_instance diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/syncsources.py --- a/cubicweb/hooks/syncsources.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/syncsources.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2010-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2010-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -27,6 +27,7 @@ from cubicweb.predicates import is_instance from cubicweb.server import SOURCE_TYPES, hook + class SourceHook(hook.Hook): __abstract__ = True category = 'cw.sources' diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/hooks/workflow.py --- a/cubicweb/hooks/workflow.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/hooks/workflow.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Core hooks: workflow related hooks""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from datetime import datetime diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/i18n.py --- a/cubicweb/i18n.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/i18n.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """Some i18n/gettext utilities.""" from __future__ import print_function -__docformat__ = "restructuredtext en" + import re import os diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/mail.py --- a/cubicweb/mail.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/mail.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Common utilies to format / send emails.""" -__docformat__ = "restructuredtext en" + from base64 import b64encode, b64decode from time import time diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/migration.py --- a/cubicweb/migration.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/migration.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """utilities for instances migration""" from __future__ import print_function -__docformat__ = "restructuredtext en" + import sys import os diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/misc/migration/3.11.0_Any.py --- a/cubicweb/misc/migration/3.11.0_Any.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/misc/migration/3.11.0_Any.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,5 +1,3 @@ -from datetime import datetime - for rtype in ('cw_support', 'cw_dont_cross', 'cw_may_cross'): drop_relation_type(rtype) diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/misc/migration/bootstrapmigration_repository.py --- a/cubicweb/misc/migration/bootstrapmigration_repository.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/misc/migration/bootstrapmigration_repository.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -15,10 +15,11 @@ # # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -"""allways executed before all others in server migration +"""Always executed before all others in server migration it should only include low level schema changes """ + from __future__ import print_function from six import text_type diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/misc/scripts/migration_helper.py --- a/cubicweb/misc/scripts/migration_helper.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/misc/scripts/migration_helper.py Fri Sep 30 18:25:08 2016 +0200 @@ -21,7 +21,7 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" + def drop_entity_types_fast(*etypes, **kwargs): """drop an entity type bypassing all hooks diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/mttransforms.py --- a/cubicweb/mttransforms.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/mttransforms.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """mime type transformation engine for cubicweb, based on mtconverter""" -__docformat__ = "restructuredtext en" + from logilab import mtconverter diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/predicates.py --- a/cubicweb/predicates.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/predicates.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """Predicate classes """ -__docformat__ = "restructuredtext en" + import logging from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/req.py --- a/cubicweb/req.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/req.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,8 +17,6 @@ # with CubicWeb. If not, see . """Base class for request/session""" -__docformat__ = "restructuredtext en" - from warnings import warn from datetime import time, datetime, timedelta diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/rqlrewrite.py --- a/cubicweb/rqlrewrite.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/rqlrewrite.py Fri Sep 30 18:25:08 2016 +0200 @@ -20,7 +20,7 @@ This is used for instance for read security checking in the repository. """ -__docformat__ = "restructuredtext en" + from six import text_type, string_types diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/rset.py --- a/cubicweb/rset.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/rset.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """The `ResultSet` class which is returned as result of an rql query""" -__docformat__ = "restructuredtext en" + from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/rtags.py --- a/cubicweb/rtags.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/rtags.py Fri Sep 30 18:25:08 2016 +0200 @@ -35,7 +35,7 @@ * ``tag_object_of`` tag a relation in the object's context * ``tag_attribute`` shortcut for tag_subject_of """ -__docformat__ = "restructuredtext en" + import logging from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/schema.py --- a/cubicweb/schema.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/schema.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,10 +16,9 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """classes to define schemas for CubicWeb""" + from __future__ import print_function -__docformat__ = "restructuredtext en" - import re from os.path import join, basename from hashlib import md5 diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/schemas/Bookmark.py --- a/cubicweb/schemas/Bookmark.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/schemas/Bookmark.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """the Bookmark entity type for internal links """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from yams.buildobjs import EntityType, RelationType, SubjectRelation, String diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/schemas/__init__.py --- a/cubicweb/schemas/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/schemas/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """some constants and classes to define schema permissions""" -__docformat__ = "restructuredtext en" + from cubicweb.schema import RO_REL_PERMS, RO_ATTR_PERMS, \ PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS, \ diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/schemas/base.py --- a/cubicweb/schemas/base.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/schemas/base.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,17 +17,15 @@ # with CubicWeb. If not, see . """core CubicWeb schema, but not necessary at bootstrap time""" -__docformat__ = "restructuredtext en" -from cubicweb import _ from yams.buildobjs import (EntityType, RelationType, RelationDefinition, - SubjectRelation, - String, TZDatetime, Datetime, Password, Interval, - Boolean, Bytes, UniqueConstraint) + SubjectRelation, String, Bytes, TZDatetime, Password) + +from cubicweb import _ from cubicweb.schema import ( RQLConstraint, WorkflowableEntityType, ERQLExpression, RRQLExpression, - PUB_SYSTEM_ENTITY_PERMS, PUB_SYSTEM_REL_PERMS, PUB_SYSTEM_ATTR_PERMS, - RO_ATTR_PERMS) + PUB_SYSTEM_REL_PERMS, PUB_SYSTEM_ATTR_PERMS, RO_ATTR_PERMS) + class CWUser(WorkflowableEntityType): """define a CubicWeb user""" @@ -321,6 +319,7 @@ default='in progress', vocabulary=[_('in progress'), _('success'), _('failed')]) + class cw_import_of(RelationDefinition): __permissions__ = RELATION_MANAGERS_PERMISSIONS subject = 'CWDataImport' diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/schemas/bootstrap.py --- a/cubicweb/schemas/bootstrap.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/schemas/bootstrap.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """core CubicWeb schema necessary for bootstrapping the actual instance's schema """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from yams.buildobjs import (EntityType, RelationType, RelationDefinition, Bytes, diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/schemas/workflow.py --- a/cubicweb/schemas/workflow.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/schemas/workflow.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """workflow related schemas """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from yams.buildobjs import (EntityType, RelationType, RelationDefinition, diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/__init__.py --- a/cubicweb/server/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -22,7 +22,7 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" + from contextlib import contextmanager diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/checkintegrity.py --- a/cubicweb/server/checkintegrity.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/checkintegrity.py Fri Sep 30 18:25:08 2016 +0200 @@ -22,8 +22,6 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" - import sys from datetime import datetime diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/edition.py --- a/cubicweb/server/edition.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/edition.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """helper classes to handle server-side edition of entities""" -__docformat__ = "restructuredtext en" + from copy import copy from yams import ValidationError diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/hook.py --- a/cubicweb/server/hook.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/hook.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -250,9 +250,6 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" - -from warnings import warn from logging import getLogger from itertools import chain @@ -267,6 +264,7 @@ from cubicweb.predicates import ExpectedValuePredicate, is_instance from cubicweb.appobject import AppObject + ENTITIES_HOOKS = set(('before_add_entity', 'after_add_entity', 'before_update_entity', 'after_update_entity', 'before_delete_entity', 'after_delete_entity')) @@ -276,8 +274,10 @@ 'server_startup', 'server_maintenance', 'server_shutdown', 'before_server_shutdown', 'session_open', 'session_close')) + ALL_HOOKS = ENTITIES_HOOKS | RELATIONS_HOOKS | SYSTEM_HOOKS + def _iter_kwargs(entities, eids_from_to, kwargs): if not entities and not eids_from_to: yield kwargs diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/migractions.py --- a/cubicweb/server/migractions.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/migractions.py Fri Sep 30 18:25:08 2016 +0200 @@ -28,7 +28,7 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" + import sys import os diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/querier.py --- a/cubicweb/server/querier.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/querier.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -20,8 +20,6 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" - from itertools import repeat from six import text_type, string_types, integer_types diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/repository.py --- a/cubicweb/server/repository.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/repository.py Fri Sep 30 18:25:08 2016 +0200 @@ -25,10 +25,9 @@ point to a cubicweb instance. * handles session management """ + from __future__ import print_function -__docformat__ = "restructuredtext en" - from warnings import warn from itertools import chain from time import time, localtime, strftime @@ -948,7 +947,6 @@ # in setdefault, this should not be changed without profiling. for eid in eids: etype = self.type_from_eid(eid, cnx) - # XXX should cache entity's cw_metainformation entity = cnx.entity_from_eid(eid, etype) try: data_by_etype[etype].append(entity) diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/schema2sql.py --- a/cubicweb/server/schema2sql.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/schema2sql.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with yams. If not, see . """write a schema as sql""" -__docformat__ = "restructuredtext en" + from hashlib import md5 diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/schemaserial.py --- a/cubicweb/server/schemaserial.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/schemaserial.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,11 +16,9 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """functions for schema / permissions (de)serialization using RQL""" + from __future__ import print_function -__docformat__ = "restructuredtext en" - -import os import json import sys import sqlite3 diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/serverconfig.py --- a/cubicweb/server/serverconfig.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/serverconfig.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """server.serverconfig definition""" from __future__ import print_function -__docformat__ = "restructuredtext en" + import sys from os.path import join, exists diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/serverctl.py --- a/cubicweb/server/serverctl.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/serverctl.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,8 +18,6 @@ """cubicweb-ctl commands and command handlers specific to the repository""" from __future__ import print_function -__docformat__ = 'restructuredtext en' - # *ctl module should limit the number of import to be imported as quickly as # possible (for cubicweb-ctl reactivity, necessary for instance for usable bash # completion). So import locally in command helpers. diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/session.py --- a/cubicweb/server/session.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/session.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,10 +16,9 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """Repository users' and internal' sessions.""" + from __future__ import print_function -__docformat__ = "restructuredtext en" - import functools import sys from time import time diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/sources/__init__.py --- a/cubicweb/server/sources/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/sources/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -16,25 +16,21 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """cubicweb server sources support""" + from __future__ import print_function -__docformat__ = "restructuredtext en" - from time import time from logging import getLogger -from base64 import b64decode from six import text_type from logilab.common import configuration from logilab.common.textutils import unormalize -from logilab.common.deprecation import deprecated from yams.schema import role_name from cubicweb import ValidationError, set_log_methods, server from cubicweb.server import SOURCE_TYPES -from cubicweb.server.edition import EditedEntity def dbg_st_search(uri, union, args, cachekey=None, prefix='rql for'): @@ -50,6 +46,7 @@ # return true so it can be used as assertion (and so be killed by python -O) return True + def dbg_results(results): if server.DEBUG & server.DBG_RQL: if len(results) > 10: @@ -392,6 +389,7 @@ except KeyError: raise RuntimeError('Unknown source type %r' % source_type) + def get_source(type, source_config, repo, eid): """return a source adapter according to the adapter field in the source's configuration diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/sources/datafeed.py --- a/cubicweb/server/sources/datafeed.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/sources/datafeed.py Fri Sep 30 18:25:08 2016 +0200 @@ -34,7 +34,7 @@ from logilab.common.deprecation import deprecated -from cubicweb import RegistryNotFound, ObjectNotFound, ValidationError, SourceException +from cubicweb import ObjectNotFound, ValidationError, SourceException from cubicweb.server.sources import AbstractSource from cubicweb.appobject import AppObject diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/sources/native.py --- a/cubicweb/server/sources/native.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/sources/native.py Fri Sep 30 18:25:08 2016 +0200 @@ -25,11 +25,8 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" - from threading import Lock from datetime import datetime -from base64 import b64encode from contextlib import contextmanager from os.path import basename import re @@ -38,7 +35,7 @@ import logging import sys -from six import PY2, text_type, binary_type, string_types +from six import PY2, text_type, string_types from six.moves import range, cPickle as pickle from logilab.common.decorators import cached, clear_cache diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/sqlutils.py --- a/cubicweb/server/sqlutils.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/sqlutils.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """SQL utilities functions and classes.""" from __future__ import print_function -__docformat__ = "restructuredtext en" + import sys import re diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/ssplanner.py --- a/cubicweb/server/ssplanner.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/ssplanner.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,8 +17,6 @@ # with CubicWeb. If not, see . """plan execution of rql queries on a single source""" -__docformat__ = "restructuredtext en" - from six import text_type from rql.stmts import Union, Select diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/data-migractions/cubes/fakeemail/schema.py --- a/cubicweb/server/test/data-migractions/cubes/fakeemail/schema.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/data-migractions/cubes/fakeemail/schema.py Fri Sep 30 18:25:08 2016 +0200 @@ -4,7 +4,7 @@ :copyright: 2006-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. :contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr """ -__docformat__ = "restructuredtext en" + from cubicweb import _ # pylint: disable-msg=E0611,F0401 diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/unittest_hook.py --- a/cubicweb/server/test/unittest_hook.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/unittest_hook.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -25,6 +25,7 @@ from cubicweb.server import hook from cubicweb.hooks import integrity, syncschema + class OperationsTC(CubicWebTC): def setUp(self): @@ -55,7 +56,10 @@ op3 = syncschema.MemSchemaNotifyChanges(cnx) self.assertEqual([op1, op2, op3], cnx.pending_operations) -class HookCalled(Exception): pass + +class HookCalled(Exception): + pass + config = TestServerConfiguration('data', __file__) config.bootstrap_cubes() @@ -65,10 +69,12 @@ global config, schema del config, schema + class AddAnyHook(hook.Hook): __regid__ = 'addany' category = 'cat1' events = ('before_add_entity',) + def __call__(self): raise HookCalled() @@ -135,59 +141,5 @@ self.assertEqual(hooks.CALLED_EVENTS['session_close'], 'anon') -# class RelationHookTC(TestCase): -# """testcase for relation hooks grouping""" -# def setUp(self): -# """ called before each test from this class """ -# self.o = HooksManager(schema) -# self.called = [] - -# def test_before_add_relation(self): -# """make sure before_xxx_relation hooks are called directly""" -# self.o.register(self._before_relation_hook, -# 'before_add_relation', 'concerne') -# self.assertEqual(self.called, []) -# self.o.call_hooks('before_add_relation', 'concerne', 'USER', -# 1, 'concerne', 2) -# self.assertEqual(self.called, [(1, 'concerne', 2)]) - -# def test_after_add_relation(self): -# """make sure after_xxx_relation hooks are deferred""" -# self.o.register(self._after_relation_hook, -# 'after_add_relation', 'concerne') -# self.assertEqual(self.called, []) -# self.o.call_hooks('after_add_relation', 'concerne', 'USER', -# 1, 'concerne', 2) -# self.o.call_hooks('after_add_relation', 'concerne', 'USER', -# 3, 'concerne', 4) -# self.assertEqual(self.called, [(1, 'concerne', 2), (3, 'concerne', 4)]) - -# def test_before_delete_relation(self): -# """make sure before_xxx_relation hooks are called directly""" -# self.o.register(self._before_relation_hook, -# 'before_delete_relation', 'concerne') -# self.assertEqual(self.called, []) -# self.o.call_hooks('before_delete_relation', 'concerne', 'USER', -# 1, 'concerne', 2) -# self.assertEqual(self.called, [(1, 'concerne', 2)]) - -# def test_after_delete_relation(self): -# """make sure after_xxx_relation hooks are deferred""" -# self.o.register(self._after_relation_hook, -# 'after_delete_relation', 'concerne') -# self.o.call_hooks('after_delete_relation', 'concerne', 'USER', -# 1, 'concerne', 2) -# self.o.call_hooks('after_delete_relation', 'concerne', 'USER', -# 3, 'concerne', 4) -# self.assertEqual(self.called, [(1, 'concerne', 2), (3, 'concerne', 4)]) - - -# def _before_relation_hook(self, cnxset, subject, r_type, object): -# self.called.append((subject, r_type, object)) - -# def _after_relation_hook(self, cnxset, subject, r_type, object): -# self.called.append((subject, r_type, object)) - - if __name__ == '__main__': unittest_main() diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/unittest_ldapsource.py --- a/cubicweb/server/test/unittest_ldapsource.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/unittest_ldapsource.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -19,6 +19,7 @@ Those tests expect to have slapd, python-ldap3 and ldapscripts packages installed. """ + from __future__ import print_function import os diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/unittest_migractions.py --- a/cubicweb/server/test/unittest_migractions.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/unittest_migractions.py Fri Sep 30 18:25:08 2016 +0200 @@ -22,7 +22,6 @@ from datetime import date from contextlib import contextmanager import tempfile -from hashlib import md5 from logilab.common.testlib import unittest_main, Tags, tag from logilab.common import tempattr diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/unittest_querier.py --- a/cubicweb/server/test/unittest_querier.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/unittest_querier.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -27,9 +27,10 @@ from logilab.common.testlib import TestCase, unittest_main from rql import BadRQLQuery +from rql.utils import register_function, FunctionDescr from cubicweb import QueryError, Unauthorized, Binary -from cubicweb.server.sqlutils import SQL_PREFIX +from cubicweb.server.sqlutils import SQL_CONNECT_HOOKS, SQL_PREFIX from cubicweb.server.utils import crypt_password from cubicweb.server.querier import manual_build_descr, _make_description from cubicweb.devtools import get_test_db_handler, TestServerConfiguration @@ -40,27 +41,33 @@ class FixedOffset(tzinfo): def __init__(self, hours=0): self.hours = hours + def utcoffset(self, dt): return timedelta(hours=self.hours) + def dst(self, dt): return timedelta(0) # register priority/severity sorting registered procedure -from rql.utils import register_function, FunctionDescr class group_sort_value(FunctionDescr): supported_backends = ('sqlite',) rtype = 'Int' + try: register_function(group_sort_value) except AssertionError: pass -from cubicweb.server.sqlutils import SQL_CONNECT_HOOKS + + def init_sqlite_connexion(cnx): + def group_sort_value(text): - return {"managers": "3", "users": "2", "guests": "1", "owners": "0"}[text] + return {"managers": "3", "users": "2", "guests": "1", "owners": "0"}[text] + cnx.create_function("GROUP_SORT_VALUE", 1, group_sort_value) + SQL_CONNECT_HOOKS['sqlite'].append(init_sqlite_connexion) @@ -1492,7 +1499,6 @@ {'x':self.session.user.eid}) self.assertEqual(rset.rows, [[u'\xe9name0']]) - def test_nonregr_description(self): """check that a correct description is built in case where infered solutions may be "fusionned" into one by the querier while all solutions @@ -1507,7 +1513,6 @@ self.assertEqual(len(rset), 2) self.assertEqual(rset.description, [('Personne',), ('Societe',)]) - def test_nonregr_cache_1(self): peid = self.qexecute("INSERT Personne X: X nom 'bidule'")[0][0] beid = self.qexecute("INSERT Basket X: X name 'tag'")[0][0] @@ -1562,7 +1567,6 @@ 'S eid %(x)s, S transition_of ET, O state_of ET', {'x': teid}) self.assertEqual(len(rset), 1) - def test_nonregr_set_datetime(self): # huum, psycopg specific self.qexecute('SET X creation_date %(date)s WHERE X eid 1', {'date': date.today()}) diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/unittest_repository.py --- a/cubicweb/server/test/unittest_repository.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/unittest_repository.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -29,7 +29,7 @@ from logilab.database import get_db_helper -from cubicweb import (BadConnectionId, ValidationError, +from cubicweb import (ValidationError, UnknownEid, AuthenticationError, Unauthorized, QueryError) from cubicweb.predicates import is_instance from cubicweb.schema import RQLConstraint diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/unittest_rql2sql.py --- a/cubicweb/server/test/unittest_rql2sql.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/unittest_rql2sql.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -19,8 +19,8 @@ from __future__ import print_function import sys -import os -from datetime import date + +from logilab import database as db from logilab.common.testlib import TestCase, unittest_main, mock_object from rql import BadRQLQuery @@ -34,15 +34,15 @@ # add a dumb registered procedure class stockproc(FunctionDescr): supported_backends = ('postgres', 'sqlite', 'mysql') + try: register_function(stockproc) -except AssertionError as ex: - pass # already registered +except AssertionError: + pass # already registered -from logilab import database as db def monkey_patch_import_driver_module(driver, drivers, quiet=True): - if not driver in drivers: + if driver not in drivers: raise db.UnknownDriver(driver) for modname in drivers[driver]: try: diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/unittest_rqlannotation.py --- a/cubicweb/server/test/unittest_rqlannotation.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/unittest_rqlannotation.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,5 +1,5 @@ # -*- coding: iso-8859-1 -*- -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -21,6 +21,7 @@ from cubicweb.devtools import TestServerConfiguration, get_test_db_handler from cubicweb.devtools.repotest import BaseQuerierTC + class SQLGenAnnotatorTC(BaseQuerierTC): def setUp(self): diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/unittest_schemaserial.py --- a/cubicweb/server/test/unittest_schemaserial.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/unittest_schemaserial.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,19 +17,21 @@ # with CubicWeb. If not, see . """unit tests for schema rql (de)serialization""" +from logilab.database import get_db_helper + +from yams import register_base_type, unregister_base_type + from cubicweb import Binary from cubicweb.schema import CubicWebSchemaLoader from cubicweb.devtools import TestServerConfiguration from cubicweb.devtools.testlib import BaseTestCase as TestCase, CubicWebTC - from cubicweb.server.schemaserial import (updateeschema2rql, updaterschema2rql, rschema2rql, eschema2rql, rdef2rql, specialize2rql, _erperms2rql as erperms2rql) -from logilab.database import get_db_helper -from yams import register_base_type, unregister_base_type schema = config = None + def setUpModule(*args): register_base_type('BabarTestType', ('jungle_speed',)) helper = get_db_helper('sqlite') diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/test/unittest_ssplanner.py --- a/cubicweb/server/test/unittest_ssplanner.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/test/unittest_ssplanner.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -20,18 +20,21 @@ from cubicweb.devtools.repotest import BasePlannerTC, check_plan from cubicweb.server.ssplanner import SSPlanner -# keep cnx so it's not garbage collected and the associated session closed + def setUpModule(*args): + # keep cnx so it's not garbage collected and the associated session closed global repo, cnx handler = get_test_db_handler(TestServerConfiguration('data', __file__)) handler.build_db_cache() global repo, cnx repo, cnx = handler.get_repo_and_cnx() + def tearDownModule(*args): global repo, cnx del repo, cnx + class SSPlannerTC(BasePlannerTC): _test = check_plan diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/server/utils.py --- a/cubicweb/server/utils.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/server/utils.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """Some utilities for the CubicWeb server.""" from __future__ import print_function -__docformat__ = "restructuredtext en" + import sys import logging diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/sobjects/notification.py --- a/cubicweb/sobjects/notification.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/sobjects/notification.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """some views to handle notification on data changes""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from itertools import repeat diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/sobjects/services.py --- a/cubicweb/sobjects/services.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/sobjects/services.py Fri Sep 30 18:25:08 2016 +0200 @@ -21,9 +21,6 @@ from six import text_type -from yams.schema import role_name - -from cubicweb import ValidationError from cubicweb.server import Service from cubicweb.predicates import match_user_groups, match_kwargs diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/sobjects/supervising.py --- a/cubicweb/sobjects/supervising.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/sobjects/supervising.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,9 +17,6 @@ # with CubicWeb. If not, see . """some hooks and views to handle supervising of any data changes""" -__docformat__ = "restructuredtext en" -from cubicweb import _ - from cubicweb import UnknownEid from cubicweb.predicates import none_rset from cubicweb.schema import display_name diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/sobjects/textparsers.py --- a/cubicweb/sobjects/textparsers.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/sobjects/textparsers.py Fri Sep 30 18:25:08 2016 +0200 @@ -22,7 +22,7 @@ will provide the text to analyze... """ -__docformat__ = "restructuredtext en" + import re diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/statsd_logger.py --- a/cubicweb/statsd_logger.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/statsd_logger.py Fri Sep 30 18:25:08 2016 +0200 @@ -55,7 +55,7 @@ """ -__docformat__ = "restructuredtext en" + import time import socket diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/tags.py --- a/cubicweb/tags.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/tags.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """helper classes to generate simple (X)HTML tags""" -__docformat__ = "restructuredtext en" + from cubicweb.uilib import simple_sgml_tag, sgml_attributes diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/test/unittest_entity.py --- a/cubicweb/test/unittest_entity.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/test/unittest_entity.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -31,7 +31,8 @@ from cubicweb.entity import can_use_rest_path from cubicweb.entities import fetch_config from cubicweb.uilib import soup2xhtml -from cubicweb.schema import RRQLExpression +from cubicweb.schema import RRQLExpression + class EntityTC(CubicWebTC): diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/test/unittest_migration.py --- a/cubicweb/test/unittest_migration.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/test/unittest_migration.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,13 +17,12 @@ # with CubicWeb. If not, see . """cubicweb.migration unit tests""" -from os.path import abspath, dirname, join +from os.path import dirname, join from logilab.common.testlib import TestCase, unittest_main from cubicweb.devtools import TestServerConfiguration from cubicweb.cwconfig import CubicWebConfiguration -from cubicweb.migration import MigrationHelper, filter_scripts, version_strictly_lower -from cubicweb.server.migractions import ServerMigrationHelper +from cubicweb.migration import filter_scripts, version_strictly_lower class Schema(dict): @@ -35,6 +34,7 @@ class MigrTestConfig(TestServerConfiguration): verbosity = 0 + def migration_scripts_dir(cls): return SMIGRDIR diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/test/unittest_rqlrewrite.py --- a/cubicweb/test/unittest_rqlrewrite.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/test/unittest_rqlrewrite.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/test/unittest_spa2rql.py --- a/cubicweb/test/unittest_spa2rql.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/test/unittest_spa2rql.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -33,7 +33,6 @@ xy.add_equivalence('Project name', 'doap:Project dc:title') - @unittest.skipIf(SKIPCAUSE, SKIPCAUSE) class XYTC(TestCase): diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/test/unittest_uilib.py --- a/cubicweb/test/unittest_uilib.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/test/unittest_uilib.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ # with CubicWeb. If not, see . """unittests for cubicweb.uilib""" -__docformat__ = "restructuredtext en" + import doctest diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/test/unittest_vregistry.py --- a/cubicweb/test/unittest_vregistry.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/test/unittest_vregistry.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -21,13 +21,11 @@ from os.path import join from cubicweb import CW_SOFTWARE_ROOT as BASE -from cubicweb.appobject import AppObject from cubicweb.cwvreg import CWRegistryStore, UnknownProperty from cubicweb.devtools import TestServerConfiguration from cubicweb.devtools.testlib import CubicWebTC from cubicweb.view import EntityAdapter -from cubes.card.entities import Card class YesSchema: def __contains__(self, something): @@ -35,6 +33,7 @@ WEBVIEWSDIR = join(BASE, 'web', 'views') + class VRegistryTC(TestCase): def setUp(self): diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/toolsutils.py --- a/cubicweb/toolsutils.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/toolsutils.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """some utilities for cubicweb command line tools""" from __future__ import print_function -__docformat__ = "restructuredtext en" + # XXX move most of this in logilab.common (shellutils ?) diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/transaction.py --- a/cubicweb/transaction.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/transaction.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """ undoable transaction objects. """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from cubicweb import RepositoryError diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/uilib.py --- a/cubicweb/uilib.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/uilib.py Fri Sep 30 18:25:08 2016 +0200 @@ -22,7 +22,7 @@ interface. """ -__docformat__ = "restructuredtext en" + import csv import re diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/utils.py --- a/cubicweb/utils.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/utils.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ from __future__ import division -__docformat__ = "restructuredtext en" + import base64 import decimal diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/view.py --- a/cubicweb/view.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/view.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """abstract views and templates classes for CubicWeb web client""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from io import BytesIO diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/__init__.py --- a/cubicweb/web/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ publisher to get a full CubicWeb web application """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from six.moves.urllib.parse import quote as urlquote diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/_exceptions.py --- a/cubicweb/web/_exceptions.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/_exceptions.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ # with CubicWeb. If not, see . """exceptions used in the core of the CubicWeb web application""" -__docformat__ = "restructuredtext en" + from six.moves import http_client diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/action.py --- a/cubicweb/web/action.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/action.py Fri Sep 30 18:25:08 2016 +0200 @@ -32,7 +32,7 @@ Many examples are available in :mod:`cubicweb.web.views.actions`. """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from cubicweb import target diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/application.py --- a/cubicweb/web/application.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/application.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """CubicWeb web client application object""" -__docformat__ = "restructuredtext en" + import contextlib from functools import wraps diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/box.py --- a/cubicweb/web/box.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/box.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """abstract box classes for CubicWeb web client""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from six import add_metaclass diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/captcha.py --- a/cubicweb/web/captcha.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/captcha.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ if you want something better... """ -__docformat__ = "restructuredtext en" + from random import randint, choice from io import BytesIO diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/component.py --- a/cubicweb/web/component.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/component.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ client """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/controller.py --- a/cubicweb/web/controller.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/controller.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """abstract controller classe for CubicWeb web client""" -__docformat__ = "restructuredtext en" + from six import PY2 diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/facet.py --- a/cubicweb/web/facet.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/facet.py Fri Sep 30 18:25:08 2016 +0200 @@ -49,7 +49,7 @@ .. comment: XXX widgets """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from functools import reduce diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/form.py --- a/cubicweb/web/form.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/form.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """abstract form classes for CubicWeb web client""" -__docformat__ = "restructuredtext en" + from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/formfields.py --- a/cubicweb/web/formfields.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/formfields.py Fri Sep 30 18:25:08 2016 +0200 @@ -62,7 +62,7 @@ .. autofunction:: cubicweb.web.formfields.guess_field """ -__docformat__ = "restructuredtext en" + from datetime import datetime, timedelta diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/formwidgets.py --- a/cubicweb/web/formwidgets.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/formwidgets.py Fri Sep 30 18:25:08 2016 +0200 @@ -93,7 +93,7 @@ .. autoclass:: cubicweb.web.formwidgets.ResetButton .. autoclass:: cubicweb.web.formwidgets.ImgButton """ -__docformat__ = "restructuredtext en" + from functools import reduce from datetime import date diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/httpcache.py --- a/cubicweb/web/httpcache.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/httpcache.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """HTTP cache managers""" -__docformat__ = "restructuredtext en" + from calendar import timegm from datetime import datetime diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/propertysheet.py --- a/cubicweb/web/propertysheet.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/propertysheet.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """property sheets allowing configuration of the web ui""" -__docformat__ = "restructuredtext en" + import re import os diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/request.py --- a/cubicweb/web/request.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/request.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,18 +17,16 @@ # with CubicWeb. If not, see . """abstract class for http request""" -__docformat__ = "restructuredtext en" - import time import random import base64 -from hashlib import sha1 # pylint: disable=E0611 +from hashlib import sha1 # pylint: disable=E0611 from calendar import timegm from datetime import date, datetime from warnings import warn from io import BytesIO -from six import PY2, binary_type, text_type, string_types +from six import PY2, text_type, string_types from six.moves import http_client from six.moves.urllib.parse import urlsplit, quote as urlquote from six.moves.http_cookies import SimpleCookie @@ -37,20 +35,20 @@ from logilab.common.decorators import cached from logilab.common.deprecation import deprecated -from logilab.mtconverter import xml_escape from cubicweb import AuthenticationError from cubicweb.req import RequestSessionBase from cubicweb.uilib import remove_html_tags, js from cubicweb.utils import HTMLHead, make_uid -from cubicweb.view import TRANSITIONAL_DOCTYPE_NOEXT from cubicweb.web import (INTERNAL_FIELD_VALUE, LOGGER, NothingToEdit, RequestError, StatusResponse) from cubicweb.web.httpcache import get_validators -from cubicweb.web.http_headers import Headers, Cookie, parseDateTime +from cubicweb.web.http_headers import Headers, Cookie + _MARKER = object() + def build_cb_uid(seed): sha = sha1(('%s%s%s' % (time.time(), seed, random.random())).encode('ascii')) return 'cb_%s' % (sha.hexdigest()) @@ -1013,7 +1011,6 @@ source_defs = _cnx_func('source_defs') get_shared_data = _cnx_func('get_shared_data') set_shared_data = _cnx_func('set_shared_data') - describe = _cnx_func('describe') # deprecated XXX # security ################################################################# diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/schemaviewer.py --- a/cubicweb/web/schemaviewer.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/schemaviewer.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """an helper class to display CubicWeb schema using ureports""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from six import string_types diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/test/unittest_views_cwsources.py --- a/cubicweb/web/test/unittest_views_cwsources.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/test/unittest_views_cwsources.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,23 @@ +# copyright 2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr +# +# This file is part of CubicWeb. +# +# CubicWeb is free software: you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation, either version 2.1 of the License, or (at your option) +# any later version. +# +# CubicWeb 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 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 . + from logilab.common import tempattr + from cubicweb.devtools.testlib import CubicWebTC from cubicweb.server.sources import datafeed diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/uicfg.py --- a/cubicweb/web/uicfg.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/uicfg.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """ This module has been moved to web.views.uicfg. """ -__docformat__ = "restructuredtext en" + from warnings import warn from cubicweb.web.views.uicfg import * diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/uihelper.py --- a/cubicweb/web/uihelper.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/uihelper.py Fri Sep 30 18:25:08 2016 +0200 @@ -43,7 +43,7 @@ .. autoclass:: cubicweb.web.uihelper.FormConfig """ -__docformat__ = "restructuredtext en" + from six import add_metaclass diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/__init__.py --- a/cubicweb/web/views/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Views, forms, actions... for the CubicWeb web client""" -__docformat__ = "restructuredtext en" + import os import sys diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/actions.py --- a/cubicweb/web/views/actions.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/actions.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Set of HTML base actions""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/ajaxcontroller.py --- a/cubicweb/web/views/ajaxcontroller.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/ajaxcontroller.py Fri Sep 30 18:25:08 2016 +0200 @@ -61,7 +61,7 @@ """ -__docformat__ = "restructuredtext en" + from warnings import warn from functools import partial diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/ajaxedit.py --- a/cubicweb/web/views/ajaxedit.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/ajaxedit.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Set of views allowing edition of entities/relations using ajax""" -__docformat__ = "restructuredtext en" + from cubicweb import role from cubicweb.view import View diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/apacherewrite.py --- a/cubicweb/web/views/apacherewrite.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/apacherewrite.py Fri Sep 30 18:25:08 2016 +0200 @@ -20,7 +20,7 @@ """ -__docformat__ = "restructuredtext en" + from re import compile diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/authentication.py --- a/cubicweb/web/views/authentication.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/authentication.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """user authentication component""" -__docformat__ = "restructuredtext en" + from logilab.common.deprecation import class_renamed diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/autoform.py --- a/cubicweb/web/views/autoform.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/autoform.py Fri Sep 30 18:25:08 2016 +0200 @@ -118,7 +118,7 @@ .. Controlling the generic relation fields """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/basecomponents.py --- a/cubicweb/web/views/basecomponents.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/basecomponents.py Fri Sep 30 18:25:08 2016 +0200 @@ -20,7 +20,7 @@ * the rql input form * the logged user link """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from logilab.mtconverter import xml_escape diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/basecontrollers.py --- a/cubicweb/web/views/basecontrollers.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/basecontrollers.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ object to handle publication. """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/basetemplates.py --- a/cubicweb/web/views/basetemplates.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/basetemplates.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """default templates for CubicWeb web client""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from logilab.mtconverter import xml_escape diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/baseviews.py --- a/cubicweb/web/views/baseviews.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/baseviews.py Fri Sep 30 18:25:08 2016 +0200 @@ -75,16 +75,12 @@ .. autoclass:: OutOfContextView """ -__docformat__ = "restructuredtext en" from cubicweb import _ -from datetime import timedelta from warnings import warn from six.moves import range -from rql import nodes - from logilab.mtconverter import TransformError, xml_escape from logilab.common.registry import yes diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/bookmark.py --- a/cubicweb/web/views/bookmark.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/bookmark.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Primary view for bookmarks + user's bookmarks box""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from logilab.mtconverter import xml_escape diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/boxes.py --- a/cubicweb/web/views/boxes.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/boxes.py Fri Sep 30 18:25:08 2016 +0200 @@ -25,7 +25,7 @@ * possible views box * startup views box """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/calendar.py --- a/cubicweb/web/views/calendar.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/calendar.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """html calendar views""" -__docformat__ = "restructuredtext en" + from cubicweb import _ import copy diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/csvexport.py --- a/cubicweb/web/views/csvexport.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/csvexport.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """csv export views""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from six import PY2 diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/cwproperties.py --- a/cubicweb/web/views/cwproperties.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/cwproperties.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Specific views for CWProperty (eg site/user preferences""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from logilab.mtconverter import xml_escape diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/cwsources.py --- a/cubicweb/web/views/cwsources.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/cwsources.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,23 +19,18 @@ CWSourceHostConfig, CWSourceSchemaConfig). """ -__docformat__ = "restructuredtext en" -from cubicweb import _ - import logging -from itertools import repeat from six.moves import range -from logilab.mtconverter import xml_escape from logilab.common.decorators import cachedproperty +from cubicweb import _ from cubicweb import Unauthorized, tags from cubicweb.utils import make_uid from cubicweb.predicates import (is_instance, score_entity, has_related_entities, match_user_groups, match_kwargs, match_view, one_line_rset) from cubicweb.view import EntityView, StartupView -from cubicweb.schema import META_RTYPES, VIRTUAL_RTYPES, display_name from cubicweb.web import Redirect, formwidgets as wdgs, facet, action from cubicweb.web.views import add_etype_button from cubicweb.web.views import (uicfg, tabs, actions, ibreadcrumbs, navigation, diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/cwuser.py --- a/cubicweb/web/views/cwuser.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/cwuser.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Specific views for users and groups""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from hashlib import sha1 # pylint: disable=E0611 diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/debug.py --- a/cubicweb/web/views/debug.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/debug.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,7 +17,6 @@ # with CubicWeb. If not, see . """management and error screens""" -__docformat__ = "restructuredtext en" from cubicweb import _ from time import strftime, localtime @@ -30,6 +29,7 @@ from cubicweb.view import StartupView from cubicweb.web.views import actions, tabs + def dict_to_html(w, dict): # XHTML doesn't allow emtpy
    nodes if dict: @@ -42,7 +42,7 @@ class SiteInfoAction(actions.ManagersAction): __regid__ = 'siteinfo' - __select__ = match_user_groups('users','managers') + __select__ = match_user_groups('users', 'managers') title = _('Site information') category = 'manage' order = 1000 diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/dotgraphview.py --- a/cubicweb/web/views/dotgraphview.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/dotgraphview.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """some basic stuff to build dot generated graph images""" -__docformat__ = "restructuredtext en" + from cubicweb import _ import tempfile diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/editcontroller.py --- a/cubicweb/web/views/editcontroller.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/editcontroller.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """The edit controller, automatically handling entity form submitting""" -__docformat__ = "restructuredtext en" + from warnings import warn from collections import defaultdict diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/editforms.py --- a/cubicweb/web/views/editforms.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/editforms.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ or a list of entities of the same type """ -__docformat__ = "restructuredtext en" + from copy import copy diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/editviews.py --- a/cubicweb/web/views/editviews.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/editviews.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Some views used to help to the edition process""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from logilab.common.decorators import cached diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/emailaddress.py --- a/cubicweb/web/views/emailaddress.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/emailaddress.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Specific views for email addresses entities""" -__docformat__ = "restructuredtext en" + from logilab.mtconverter import xml_escape diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/error.py --- a/cubicweb/web/views/error.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/error.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ as startup views and are used for standard error pages (404, 500, etc.) """ -__docformat__ = "restructuredtext en" + from cubicweb.view import StartupView diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/facets.py --- a/cubicweb/web/views/facets.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/facets.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """the facets box and some basic facets""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/formrenderers.py --- a/cubicweb/web/views/formrenderers.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/formrenderers.py Fri Sep 30 18:25:08 2016 +0200 @@ -32,7 +32,7 @@ """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/forms.py --- a/cubicweb/web/views/forms.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/forms.py Fri Sep 30 18:25:08 2016 +0200 @@ -42,7 +42,7 @@ but you'll use this one rarely. """ -__docformat__ = "restructuredtext en" + import time diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/ibreadcrumbs.py --- a/cubicweb/web/views/ibreadcrumbs.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/ibreadcrumbs.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """breadcrumbs components definition for CubicWeb web client""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/idownloadable.py --- a/cubicweb/web/views/idownloadable.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/idownloadable.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ Specific views for entities adapting to IDownloadable ===================================================== """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from six.moves import range diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/json.py --- a/cubicweb/web/views/json.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/json.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """json export views""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from cubicweb.uilib import rest_traceback diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/magicsearch.py --- a/cubicweb/web/views/magicsearch.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/magicsearch.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """a query processor to handle quick search shortcuts for cubicweb """ -__docformat__ = "restructuredtext en" + import re from logging import getLogger diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/management.py --- a/cubicweb/web/views/management.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/management.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """security management and error screens""" -__docformat__ = "restructuredtext en" + from cubicweb import _ diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/navigation.py --- a/cubicweb/web/views/navigation.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/navigation.py Fri Sep 30 18:25:08 2016 +0200 @@ -45,7 +45,7 @@ .. autoclass:: NextPrevNavigationComponent """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from datetime import datetime diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/owl.py --- a/cubicweb/web/views/owl.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/owl.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """produces some Ontology Web Language schema and views """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from six.moves import range diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/plots.py --- a/cubicweb/web/views/plots.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/plots.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """basic plot views""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from six import add_metaclass diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/primary.py --- a/cubicweb/web/views/primary.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/primary.py Fri Sep 30 18:25:08 2016 +0200 @@ -37,7 +37,7 @@ .. autoclass:: VerbatimAttributeView """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/pyviews.py --- a/cubicweb/web/views/pyviews.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/pyviews.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Basic views for python values (eg without any result set) """ -__docformat__ = "restructuredtext en" + from six import text_type from six.moves import range diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/rdf.py --- a/cubicweb/web/views/rdf.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/rdf.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """base xml and rss views""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from six.moves import range diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/reledit.py --- a/cubicweb/web/views/reledit.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/reledit.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ form """ -__docformat__ = "restructuredtext en" + from cubicweb import _ import copy diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/schema.py --- a/cubicweb/web/views/schema.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/schema.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """Specific views for schema related entities""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from itertools import cycle diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/searchrestriction.py --- a/cubicweb/web/views/searchrestriction.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/searchrestriction.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ a search """ -__docformat__ = "restructuredtext en" + from logilab.common.deprecation import moved diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/sessions.py --- a/cubicweb/web/views/sessions.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/sessions.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . """web session: by default the session is actually the db connection """ -__docformat__ = "restructuredtext en" + from time import time from logging import getLogger diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/sparql.py --- a/cubicweb/web/views/sparql.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/sparql.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """SPARQL integration""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from six.moves import range diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/startup.py --- a/cubicweb/web/views/startup.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/startup.py Fri Sep 30 18:25:08 2016 +0200 @@ -21,7 +21,7 @@ .. autoclass:: ManageView """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from logilab.common.textutils import unormalize diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/tableview.py --- a/cubicweb/web/views/tableview.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/tableview.py Fri Sep 30 18:25:08 2016 +0200 @@ -60,7 +60,7 @@ :members: """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/tabs.py --- a/cubicweb/web/views/tabs.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/tabs.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """base classes to handle tabbed views""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from six import string_types diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/timetable.py --- a/cubicweb/web/views/timetable.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/timetable.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """html timetable views""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from six.moves import range diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/treeview.py --- a/cubicweb/web/views/treeview.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/treeview.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ plugin. """ -__docformat__ = "restructuredtext en" + from cubicweb import _ from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/uicfg.py --- a/cubicweb/web/views/uicfg.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/uicfg.py Fri Sep 30 18:25:08 2016 +0200 @@ -53,7 +53,7 @@ # primary view uicfg.actionbox_appearsin_addmenu.tag_object_of(('*', 'entry_of', 'Blog'), True) """ -__docformat__ = "restructuredtext en" + from warnings import warn diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/undohistory.py --- a/cubicweb/web/views/undohistory.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/undohistory.py Fri Sep 30 18:25:08 2016 +0200 @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License along # with CubicWeb. If not, see . -__docformat__ = "restructuredtext en" + from cubicweb import _ diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/urlpublishing.py --- a/cubicweb/web/views/urlpublishing.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/urlpublishing.py Fri Sep 30 18:25:08 2016 +0200 @@ -55,7 +55,7 @@ Actionpath executes a query whose results is lost because of redirecting instead of direct traversal. """ -__docformat__ = "restructuredtext en" + from rql import TypeResolverException diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/vcard.py --- a/cubicweb/web/views/vcard.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/vcard.py Fri Sep 30 18:25:08 2016 +0200 @@ -18,7 +18,7 @@ """vcard import / export """ -__docformat__ = "restructuredtext en" + from cubicweb.predicates import is_instance from cubicweb.view import EntityView diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/wdoc.py --- a/cubicweb/web/views/wdoc.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/wdoc.py Fri Sep 30 18:25:08 2016 +0200 @@ -19,7 +19,7 @@ CubicWeb and cubes """ -__docformat__ = "restructuredtext en" + from itertools import chain from os.path import join diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/workflow.py --- a/cubicweb/web/views/workflow.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/workflow.py Fri Sep 30 18:25:08 2016 +0200 @@ -21,7 +21,7 @@ * workflow entities views (State, Transition, TrInfo) """ -__docformat__ = "restructuredtext en" + from cubicweb import _ import os diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/xbel.py --- a/cubicweb/web/views/xbel.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/xbel.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """xbel views""" -__docformat__ = "restructuredtext en" + from cubicweb import _ from six.moves import range diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/views/xmlrss.py --- a/cubicweb/web/views/xmlrss.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/views/xmlrss.py Fri Sep 30 18:25:08 2016 +0200 @@ -1,4 +1,4 @@ -# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. +# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of CubicWeb. @@ -17,7 +17,6 @@ # with CubicWeb. If not, see . """base xml and rss views""" -__docformat__ = "restructuredtext en" from cubicweb import _ from base64 import b64encode @@ -28,11 +27,12 @@ from logilab.mtconverter import xml_escape from cubicweb.predicates import (is_instance, non_final_entity, one_line_rset, - appobject_selectable, adaptable) + appobject_selectable, adaptable) from cubicweb.view import EntityView, EntityAdapter, AnyRsetView, Component from cubicweb.uilib import simple_sgml_tag from cubicweb.web import httpcache, component + def encode_bytes(value): return '' % b64encode(value.getvalue()) @@ -110,7 +110,7 @@ else: self.error('badly formated relation name %r', relstr) continue - if not rtype in getrschema: + if rtype not in getrschema: self.error('unexisting relation %r', relstr) continue self.w(u' <%s role="%s">\n' % (rtype, role)) diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/webconfig.py --- a/cubicweb/web/webconfig.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/webconfig.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """web ui configuration for cubicweb instances""" -__docformat__ = "restructuredtext en" + from cubicweb import _ import os diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/web/webctl.py --- a/cubicweb/web/webctl.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/web/webctl.py Fri Sep 30 18:25:08 2016 +0200 @@ -20,7 +20,7 @@ """ from __future__ import print_function -__docformat__ = "restructuredtext en" + import os, os.path as osp from shutil import copy, rmtree diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/wsgi/__init__.py --- a/cubicweb/wsgi/__init__.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/wsgi/__init__.py Fri Sep 30 18:25:08 2016 +0200 @@ -24,7 +24,7 @@ WSGI corresponding PEP: http://www.python.org/dev/peps/pep-0333/ """ -__docformat__ = "restructuredtext en" + from email import message, message_from_string from pprint import pformat as _pformat diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/wsgi/handler.py --- a/cubicweb/wsgi/handler.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/wsgi/handler.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """WSGI request handler for cubicweb""" -__docformat__ = "restructuredtext en" + from itertools import chain, repeat diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/wsgi/request.py --- a/cubicweb/wsgi/request.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/wsgi/request.py Fri Sep 30 18:25:08 2016 +0200 @@ -23,7 +23,7 @@ """ -__docformat__ = "restructuredtext en" + import tempfile diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/wsgi/server.py --- a/cubicweb/wsgi/server.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/wsgi/server.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """dummy wsgi server for CubicWeb web instances""" -__docformat__ = "restructuredtext en" + from cubicweb.wsgi.handler import CubicWebWSGIApplication from cubicweb import ConfigurationError diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/wsgi/tnd.py --- a/cubicweb/wsgi/tnd.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/wsgi/tnd.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """tornado wsgi server for CubicWeb web instances""" -__docformat__ = "restructuredtext en" + from cubicweb.wsgi.handler import CubicWebWSGIApplication diff -r d8de1ac21f36 -r 432f87a63057 cubicweb/wsgi/wz.py --- a/cubicweb/wsgi/wz.py Wed Oct 05 15:28:43 2016 +0200 +++ b/cubicweb/wsgi/wz.py Fri Sep 30 18:25:08 2016 +0200 @@ -17,7 +17,7 @@ # with CubicWeb. If not, see . """dummy wsgi server for CubicWeb web instances""" -__docformat__ = "restructuredtext en" + import socket