flake8 and all
* update some copyright
* drop most __docformat__ declaration
* fix some flake8 warnings / errors
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Exceptions shared by different cubicweb packages."""
-__docformat__ = "restructuredtext en"
+
from warnings import warn
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Simple cryptographic routines, based on python-crypto."""
-__docformat__ = "restructuredtext en"
+
from base64 import b64encode, b64decode
--- 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
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""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
--- 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 <http://www.gnu.org/licenses/>.
"""Test tools for cubicweb"""
+
from __future__ import print_function
-__docformat__ = "restructuredtext en"
-
import os
import sys
import errno
--- 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
--- 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
--- 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
--- 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]))
--- 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 <http://www.gnu.org/licenses/>.
-"""this module contains base classes and utilities for cubicweb tests"""
+"""Base classes and utilities for cubicweb tests"""
+
from __future__ import print_function
import sys
--- 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 <http://www.gnu.org/licenses/>.
"""base application's entities class implementation: `AnyEntity`"""
-__docformat__ = "restructuredtext en"
+
from warnings import warn
--- 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.
--- 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 <http://www.gnu.org/licenses/>.
"""entity classes user and group entities"""
-__docformat__ = "restructuredtext en"
+
from six import string_types, text_type
--- 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 <http://www.gnu.org/licenses/>.
"""entity classes for optional library entities"""
-__docformat__ = "restructuredtext en"
+
from warnings import warn
from datetime import datetime
--- 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 <http://www.gnu.org/licenses/>.
"""schema definition related entities"""
-__docformat__ = "restructuredtext en"
+
from logilab.common.decorators import cached
--- 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 <http://www.gnu.org/licenses/>.
"""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):
--- 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.
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""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:
--- 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.
--- 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 <http://www.gnu.org/licenses/>.
"""Twisted request handler for CubicWeb"""
-__docformat__ = "restructuredtext en"
+
from cubicweb.web.request import CubicWebRequestBase
--- 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 <http://www.gnu.org/licenses/>.
"""twisted server for CubicWeb web instances"""
-__docformat__ = "restructuredtext en"
+
import sys
import select
--- 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
--- 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 <http://www.gnu.org/licenses/>.
-"""
-
-"""
# 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
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""core hooks registering some maintainance tasks as server startup time"""
-__docformat__ = "restructuredtext en"
+
from datetime import timedelta, datetime
--- 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 <http://www.gnu.org/licenses/>.
"""bookmark related hooks"""
-__docformat__ = "restructuredtext en"
+
from cubicweb.server import hook
--- 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 <http://www.gnu.org/licenses/>.
"""hooks to ensure use_email / primary_email relations consistency"""
-__docformat__ = "restructuredtext en"
+
from cubicweb.server import hook
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""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):
--- 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 <http://www.gnu.org/licenses/>.
"""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
--- 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:
--- 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 <http://www.gnu.org/licenses/>.
"""Hooks for synchronizing computed attributes"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from collections import defaultdict
--- 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,
--- 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 <http://www.gnu.org/licenses/>.
"""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
--- 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'
--- 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 <http://www.gnu.org/licenses/>.
"""Core hooks: workflow related hooks"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from datetime import datetime
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Common utilies to format / send emails."""
-__docformat__ = "restructuredtext en"
+
from base64 import b64encode, b64decode
from time import time
--- 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
--- 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)
--- 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 <http://www.gnu.org/licenses/>.
-"""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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""mime type transformation engine for cubicweb, based on mtconverter"""
-__docformat__ = "restructuredtext en"
+
from logilab import mtconverter
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Base class for request/session"""
-__docformat__ = "restructuredtext en"
-
from warnings import warn
from datetime import time, datetime, timedelta
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""The `ResultSet` class which is returned as result of an rql query"""
-__docformat__ = "restructuredtext en"
+
from warnings import warn
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""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, \
--- 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 <http://www.gnu.org/licenses/>.
"""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'
--- 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,
--- 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,
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""helper classes to handle server-side edition of entities"""
-__docformat__ = "restructuredtext en"
+
from copy import copy
from yams import ValidationError
--- 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
--- 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
--- 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
--- 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)
--- 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 <http://www.gnu.org/licenses/>.
"""write a schema as sql"""
-__docformat__ = "restructuredtext en"
+
from hashlib import md5
--- 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 <http://www.gnu.org/licenses/>.
"""functions for schema / permissions (de)serialization using RQL"""
+
from __future__ import print_function
-__docformat__ = "restructuredtext en"
-
-import os
import json
import sys
import sqlite3
--- 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
--- 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.
--- 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 <http://www.gnu.org/licenses/>.
"""Repository users' and internal' sessions."""
+
from __future__ import print_function
-__docformat__ = "restructuredtext en"
-
import functools
import sys
from time import time
--- 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 <http://www.gnu.org/licenses/>.
"""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
--- 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
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""plan execution of rql queries on a single source"""
-__docformat__ = "restructuredtext en"
-
from six import text_type
from rql.stmts import Union, Select
--- 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
--- 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()
--- 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
--- 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
--- 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()})
--- 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
--- 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:
--- 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):
--- 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 <http://www.gnu.org/licenses/>.
"""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')
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""some views to handle notification on data changes"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from itertools import repeat
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""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
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""helper classes to generate simple (X)HTML tags"""
-__docformat__ = "restructuredtext en"
+
from cubicweb.uilib import simple_sgml_tag, sgml_attributes
--- 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):
--- 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 <http://www.gnu.org/licenses/>.
"""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
--- 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.
--- 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):
--- 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 <http://www.gnu.org/licenses/>.
"""unittests for cubicweb.uilib"""
-__docformat__ = "restructuredtext en"
+
import doctest
--- 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):
--- 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 ?)
--- 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 <http://www.gnu.org/licenses/>.
""" undoable transaction objects. """
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from cubicweb import RepositoryError
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""abstract views and templates classes for CubicWeb web client"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from io import BytesIO
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""exceptions used in the core of the CubicWeb web application"""
-__docformat__ = "restructuredtext en"
+
from six.moves import http_client
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""CubicWeb web client application object"""
-__docformat__ = "restructuredtext en"
+
import contextlib
from functools import wraps
--- 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 <http://www.gnu.org/licenses/>.
"""abstract box classes for CubicWeb web client"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from six import add_metaclass
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""abstract controller classe for CubicWeb web client"""
-__docformat__ = "restructuredtext en"
+
from six import PY2
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""abstract form classes for CubicWeb web client"""
-__docformat__ = "restructuredtext en"
+
from warnings import warn
--- 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
--- 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
--- 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://www.gnu.org/licenses/>.
"""HTTP cache managers"""
-__docformat__ = "restructuredtext en"
+
from calendar import timegm
from datetime import datetime
--- 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 <http://www.gnu.org/licenses/>.
"""property sheets allowing configuration of the web ui"""
-__docformat__ = "restructuredtext en"
+
import re
import os
--- 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 <http://www.gnu.org/licenses/>.
"""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 #################################################################
--- 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 <http://www.gnu.org/licenses/>.
"""an helper class to display CubicWeb schema using ureports"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from six import string_types
--- 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 <http://www.gnu.org/licenses/>.
+
from logilab.common import tempattr
+
from cubicweb.devtools.testlib import CubicWebTC
from cubicweb.server.sources import datafeed
--- 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 *
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Views, forms, actions... for the CubicWeb web client"""
-__docformat__ = "restructuredtext en"
+
import os
import sys
--- 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 <http://www.gnu.org/licenses/>.
"""Set of HTML base actions"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from warnings import warn
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Set of views allowing edition of entities/relations using ajax"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import role
from cubicweb.view import View
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""user authentication component"""
-__docformat__ = "restructuredtext en"
+
from logilab.common.deprecation import class_renamed
--- 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
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""default templates for CubicWeb web client"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from logilab.mtconverter import xml_escape
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Primary view for bookmarks + user's bookmarks box"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from logilab.mtconverter import xml_escape
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""html calendar views"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
import copy
--- 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 <http://www.gnu.org/licenses/>.
"""csv export views"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from six import PY2
--- 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 <http://www.gnu.org/licenses/>.
"""Specific views for CWProperty (eg site/user preferences"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from logilab.mtconverter import xml_escape
--- 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,
--- 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 <http://www.gnu.org/licenses/>.
"""Specific views for users and groups"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from hashlib import sha1 # pylint: disable=E0611
--- 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 <http://www.gnu.org/licenses/>.
"""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 <ul> 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
--- 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 <http://www.gnu.org/licenses/>.
"""some basic stuff to build dot generated graph images"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
import tempfile
--- 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 <http://www.gnu.org/licenses/>.
"""The edit controller, automatically handling entity form submitting"""
-__docformat__ = "restructuredtext en"
+
from warnings import warn
from collections import defaultdict
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Some views used to help to the edition process"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from logilab.common.decorators import cached
--- 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 <http://www.gnu.org/licenses/>.
"""Specific views for email addresses entities"""
-__docformat__ = "restructuredtext en"
+
from logilab.mtconverter import xml_escape
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""the facets box and some basic facets"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from warnings import warn
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""breadcrumbs components definition for CubicWeb web client"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from warnings import warn
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""json export views"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from cubicweb.uilib import rest_traceback
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""security management and error screens"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""basic plot views"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from six import add_metaclass
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Basic views for python values (eg without any result set)
"""
-__docformat__ = "restructuredtext en"
+
from six import text_type
from six.moves import range
--- 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 <http://www.gnu.org/licenses/>.
"""base xml and rss views"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from six.moves import range
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""Specific views for schema related entities"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from itertools import cycle
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""web session: by default the session is actually the db connection """
-__docformat__ = "restructuredtext en"
+
from time import time
from logging import getLogger
--- 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 <http://www.gnu.org/licenses/>.
"""SPARQL integration"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from six.moves import range
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""base classes to handle tabbed views"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from six import string_types
--- 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 <http://www.gnu.org/licenses/>.
"""html timetable views"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from six.moves import range
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
--- 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
--- 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
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""xbel views"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
from six.moves import range
--- 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 <http://www.gnu.org/licenses/>.
"""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 '<![CDATA[%s]]>' % 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))
--- 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 <http://www.gnu.org/licenses/>.
"""web ui configuration for cubicweb instances"""
-__docformat__ = "restructuredtext en"
+
from cubicweb import _
import os
--- 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
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""WSGI request handler for cubicweb"""
-__docformat__ = "restructuredtext en"
+
from itertools import chain, repeat
--- 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
--- 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 <http://www.gnu.org/licenses/>.
"""dummy wsgi server for CubicWeb web instances"""
-__docformat__ = "restructuredtext en"
+
from cubicweb.wsgi.handler import CubicWebWSGIApplication
from cubicweb import ConfigurationError
--- 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 <http://www.gnu.org/licenses/>.
"""tornado wsgi server for CubicWeb web instances"""
-__docformat__ = "restructuredtext en"
+
from cubicweb.wsgi.handler import CubicWebWSGIApplication
--- 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 <http://www.gnu.org/licenses/>.
"""dummy wsgi server for CubicWeb web instances"""
-__docformat__ = "restructuredtext en"
+
import socket