Commit 3da1e815 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

fix incorrect merges 3.27.{4,5} into 3.28

--HG--
branch : 3.28
parent 7af740ef0396
Pipeline #63600 failed with stages
in 20 minutes and 22 seconds
......@@ -15,7 +15,7 @@ Source0: https://pypi.python.org/packages/source/c/cubicweb/cubicweb-%{ve
License: LGPLv2+
Group: Development/Languages/Python
Vendor: Logilab <contact@logilab.fr>
Url: https://www.cubicweb.org/project/cubicweb
Url: https://forge.extranet.logilab.fr/cubicweb/cubicweb
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch: noarch
......
......@@ -66,7 +66,7 @@ your pyramid configuration file:
.. _CubicWeb: https://www.cubicweb.org/
.. _`cubicweb-rememberme`: \
https://www.cubicweb.org/project/cubicweb-rememberme
https://forge.extranet.logilab.fr/cubicweb/cubes/rememberme
.. _AuthTktAuthenticationPolicy: \
http://docs.pylonsproject.org/projects/pyramid/en/latest/api/authentication.html#pyramid.authentication.AuthTktAuthenticationPolicy
......
# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# copyright 2003-2020 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact https://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
#
......@@ -14,7 +14,7 @@
# 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/>.
# with CubicWeb. If not, see <https://www.gnu.org/licenses/>.
"""Defines the central class for the CubicWeb RQL server: the repository.
The repository is an abstraction allowing execution of rql queries against
......@@ -47,11 +47,11 @@ from cubicweb.server import utils, hook, querier, sources
from cubicweb.server.session import InternalManager, Connection
NO_CACHE_RELATIONS = set([
NO_CACHE_RELATIONS = {
('owned_by', 'object'),
('created_by', 'object'),
('cw_source', 'object'),
])
}
def prefill_entity_caches(entity):
......@@ -304,7 +304,7 @@ class _CnxSetPool(_BaseCnxSet):
'by changing the connections-pool-max-size option in your '
'configuration file)')
else:
self.debug("[pool] we had to open a new connection, connection number: %s/%s" %
self.debug("[pool] we had to open a new connection, connection number: %d/%d" %
(self.size(), self.max_size))
return self._new_cnxset()
......@@ -351,10 +351,8 @@ def get_cnxset(config, source, bootstrap=False):
if bootstrap or config.quick_start:
min_size, max_size = 0, 1
else:
min_size, max_size = (
config['connections-pool-min-size'],
config['connections-pool-max-size'],
)
min_size = config['connections-pool-min-size']
max_size = config['connections-pool-max-size']
return _CnxSetPool(source, min_size=min_size, max_size=max_size,
idle_timeout=idle_timeout)
......@@ -499,7 +497,7 @@ class Repository(object):
return
with self.internal_cnx() as cnx:
sourceent = cnx.execute(
'Any S, SA, SC WHERE S is_instance_of CWSource,'
'Any S, SA, SC LIMIT 2 WHERE S is_instance_of CWSource,'
' S name "system", S type SA, S config SC'
).one()
self.system_source.eid = sourceent.eid
......
# copyright 2003-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# copyright 2003-2020 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact https://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of CubicWeb.
#
......@@ -14,7 +14,8 @@
# 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/>.
# with CubicWeb. If not, see <https://www.gnu.org/licenses/>.
"""Repository users' and internal' sessions."""
import functools
......@@ -339,7 +340,8 @@ class Connection(RequestSessionBase):
self._open = True
self.cnxset = self.repo.cnxsets.get()
if self.lang is None:
self.set_language(self.user.prefered_language())
self.lang = self.user.prefered_language()
self.set_language(self.lang)
return self
def __exit__(self, exctype=None, excvalue=None, tb=None):
......
......@@ -370,6 +370,9 @@ class HTMLHeadTC(CubicWebTC):
head.add_js(base_url + u'bob1.js')
head.add_js(u'http://ext.com/bob2.js')
head.add_js(u'http://ext.com/bob3.js')
head.write_front(
'<script type="text/javascript">console.log("FIRST SCRIPT ADDED HERE")</script>\n'
)
head.add_css(base_url + u'bob4.css')
head.add_css(base_url + u'bob5.css')
head.add_css(base_url + u'bob6.css', 'print')
......@@ -378,6 +381,7 @@ class HTMLHeadTC(CubicWebTC):
head.add_ie_css(base_url + u'bob9.css', 'print', u'[if lt IE 7]')
result = head.getvalue()
expected = u"""<head>
<script type="text/javascript">console.log("FIRST SCRIPT ADDED HERE")</script>
<link rel="stylesheet" type="text/css" media="all" href="http://test.fr/data/bob4.css"/>
<link rel="stylesheet" type="text/css" media="all" href="http://test.fr/data/bob5.css"/>
<link rel="stylesheet" type="text/css" media="print" href="http://test.fr/data/bob6.css"/>
......
......@@ -27,6 +27,7 @@ import re
import json
from operator import itemgetter
from inspect import getfullargspec as getargspec
from functools import wraps
from itertools import repeat
from uuid import uuid4
from threading import Lock
......@@ -181,6 +182,20 @@ class RepeatList(object):
self._size -= 1
def handle_writing_constraints(method):
@wraps(method)
def wrapper(self, value):
if self.tracewrites:
from traceback import format_stack
stack = format_stack(None)[:-1]
escaped_stack = xml_escape(json_dumps(u'\n'.join(stack)))
escaped_html = xml_escape(value).replace('\n', '<br/>\n')
tpl = u'<span onclick="alert(%s)">%s</span>'
value = tpl % (escaped_stack, escaped_html)
return method(self, value)
return wrapper
class UStringIO(list):
"""a file wrapper which automatically encode unicode string to an encoding
specifed in the constructor
......@@ -195,16 +210,14 @@ class UStringIO(list):
__nonzero__ = __bool__
@handle_writing_constraints
def write(self, value):
if self.tracewrites:
from traceback import format_stack
stack = format_stack(None)[:-1]
escaped_stack = xml_escape(json_dumps(u'\n'.join(stack)))
escaped_html = xml_escape(value).replace('\n', '<br/>\n')
tpl = u'<span onclick="alert(%s)">%s</span>'
value = tpl % (escaped_stack, escaped_html)
self.append(value)
@handle_writing_constraints
def write_front(self, value):
self.insert(0, value)
def getvalue(self):
return u''.join(self)
......
......@@ -35,7 +35,7 @@ environment.
.. _cubicweb: https://www.cubicweb.org/
.. _overview: https://docs.cubicweb.org/tutorials/base/index.html
.. _forge: https://www.cubicweb.org/project?vtitle=All%20cubicweb%20projects
.. _forge: https://forge.extranet.logilab.fr/cubicweb/cubicweb
.. _installation: https://docs.cubicweb.org/book/admin/setup.html#setupenv
Home page
......
......@@ -38,8 +38,8 @@ L'impatient sautera sur les consignes d'installation_.
.. _CubicWeb: http://www.cubicweb.org/
.. _présentation: http://www.cubicweb.org/doc/en/A020-tutorial.en.html#overview
.. _forge: http://www.cubicweb.org/project?vtitle=All%20cubicweb%20projects
.. _installation: http://www.cubicweb.org/doc/en/C010-setup.en.html#miseenplaceenv
.. _forge: https://forge.extranet.logilab.fr/cubicweb/cubicweb
.. _installation: https://cubicweb.readthedocs.io/en/latest/book/admin/setup/#setupenv
Site Web
--------
......
......@@ -41,7 +41,7 @@ it is also possible to use the `cwtags`_ library to build html trees
using the `with statement`_ with more comfort than raw strings.
.. _`simpletal`: http://www.owlfish.com/software/simpleTAL/
.. _`cwtags`: http://www.cubicweb.org/project/cwtags
.. _`cwtags`: https://forge.extranet.logilab.fr/cubicweb/cubes/tag
.. _`with statement`: http://www.python.org/dev/peps/pep-0343/
Why do you think using pure python is better than using a template language ?
......@@ -64,7 +64,7 @@ It is constantly evolving, piece by piece. The framework has evolved since
is a well-defined way to handle data and schema migration.
You can see the roadmap there:
http://www.cubicweb.org/project/cubicweb?tab=projectroadmap_tab.
https://forge.extranet.logilab.fr/cubicweb/cubicweb/-/boards.
Why is the RQL query language looking similar to X ?
......
......@@ -39,22 +39,22 @@ Other features
.. _addressbook: http://www.cubicweb.org/project/cubicweb-addressbook
.. _basket: http://www.cubicweb.org/project/cubicweb-basket
.. _card: http://www.cubicweb.org/project/cubicweb-card
.. _blog: http://www.cubicweb.org/project/cubicweb-blog
.. _comment: http://www.cubicweb.org/project/cubicweb-comment
.. _email: http://www.cubicweb.org/project/cubicweb-email
.. _event: http://www.cubicweb.org/project/cubicweb-event
.. _file: http://www.cubicweb.org/project/cubicweb-file
.. _folder: http://www.cubicweb.org/project/cubicweb-folder
.. _keyword: http://www.cubicweb.org/project/cubicweb-keyword
.. _link: http://www.cubicweb.org/project/cubicweb-link
.. _mailinglist: http://www.cubicweb.org/project/cubicweb-mailinglist
.. _person: http://www.cubicweb.org/project/cubicweb-person
.. _tag: http://www.cubicweb.org/project/cubicweb-tag
.. _task: http://www.cubicweb.org/project/cubicweb-task
.. _zone: http://www.cubicweb.org/project/cubicweb-zone
.. _addressbook: https://forge.extranet.logilab.fr/cubicweb/cubes/addressbook
.. _basket: https://forge.extranet.logilab.fr/cubicweb/cubes/basket
.. _card: https://forge.extranet.logilab.fr/cubicweb/cubes/card
.. _blog: https://forge.extranet.logilab.fr/cubicweb/cubes/blog
.. _comment: https://forge.extranet.logilab.fr/cubicweb/cubes/comment
.. _email: https://forge.extranet.logilab.fr/cubicweb/cubes/email
.. _event: https://forge.extranet.logilab.fr/cubicweb/cubes/event
.. _file: https://forge.extranet.logilab.fr/cubicweb/cubes/file
.. _folder: https://forge.extranet.logilab.fr/cubicweb/cubes/folder
.. _keyword: https://forge.extranet.logilab.fr/cubicweb/cubes/keyword
.. _link: https://forge.extranet.logilab.fr/cubicweb/cubes/link
.. _mailinglist: https://forge.extranet.logilab.fr/cubicweb/cubes/mailinglist
.. _person: https://forge.extranet.logilab.fr/cubicweb/cubes/person
.. _tag: https://forge.extranet.logilab.fr/cubicweb/cubes/tag
.. _task: https://forge.extranet.logilab.fr/cubicweb/cubes/task
.. _zone: https://forge.extranet.logilab.fr/cubicweb/cubes/zone
To declare the use of a cube, once installed, add the name of the cube
and its dependency relation in the `__depends_cubes__` dictionary
......@@ -63,4 +63,4 @@ defined in the file `__pkginfo__.py` of your own component.
.. note::
The listed cubes above are available as debian-packages on `CubicWeb's forge`_.
.. _`CubicWeb's forge`: http://www.cubicweb.org/project?vtitle=All%20cubicweb%20projects
.. _`CubicWeb's forge`: https://forge.extranet.logilab.fr/cubicweb/
......@@ -153,7 +153,7 @@ Project class.
'V version_of P, P eid %%(p)s' % (order, ','.join(repr(s) for s in states))
return self._cw.execute(rql, {'p': self.eid})
.. _`tracker`: http://www.cubicweb.org/project/cubicweb-tracker/
.. _`tracker`: https://forge.extranet.logilab.fr/cubicweb/cubes/tracker/
These few lines exhibit the important properties we want to outline:
......
......@@ -213,7 +213,7 @@ right circumstances add a new HTTP `x-foo-user` header to the query
before it reaches the CubicWeb instance. For a concrete example of
this, see the `trustedauth`_ cube.
.. _`trustedauth`: http://www.cubicweb.org/project/cubicweb-trustedauth
.. _`trustedauth`: https://forge.extranet.logilab.fr/cubicweb/cubes/trustedauth
Repository authentication plugins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -43,7 +43,7 @@ Unit test by example
````````````````````
We start with an example extracted from the keyword cube (available
from http://www.cubicweb.org/project/cubicweb-keyword).
from https://forge.extranet.logilab.fr/cubicweb/cubes/keyword).
.. sourcecode:: python
......@@ -104,7 +104,7 @@ You can see an example of security tests in the
It is possible to have these tests run continuously using `apycot`_.
.. _apycot: http://www.cubicweb.org/project/apycot
.. _apycot: https://forge.extranet.logilab.fr/cubicweb/cubes/apycot
.. _securitytest:
......@@ -192,7 +192,7 @@ It is easy to write unit tests to test actions which are visible to
a user or to a category of users. Let's take an example in the
`conference cube`_.
.. _`conference cube`: http://www.cubicweb.org/project/cubicweb-conference
.. _`conference cube`: https://forge.extranet.logilab.fr/cubicweb/cubes/conference
.. sourcecode:: python
class ConferenceActionsTC(CubicWebTC):
......
......@@ -8,7 +8,7 @@ This is done (again) with a vanilla instance of the `tracker`_
cube. We will populate the database with a bunch of entities and see
what kind of job the automatic entity form does.
.. _`tracker`: http://www.cubicweb.org/project/cubicweb-tracker
.. _`tracker`: https://forge.extranet.logilab.fr/cubicweb/cubes/tracker
Populating the database
~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -67,7 +67,7 @@ the `choices` parameter of the relation tag that is applied to the
and sophisticated enough. This is a code snippet from the `tracker`_
cube.
.. _`tracker`: http://www.cubicweb.org/project/cubicweb-tracker
.. _`tracker`: https://forge.extranet.logilab.fr/cubicweb/cubes/tracker
The ``Ticket`` entity type can be related to a ``Project`` and a
``Version``, respectively through the ``concerns`` and ``done_in``
......
......@@ -33,9 +33,9 @@ and available under a free software license.
The command :command:`cubicweb-ctl list` displays the list of available cubes.
.. _`CubicWeb.org Forge`: http://www.cubicweb.org/project/
.. _`cubicweb-blog`: http://www.cubicweb.org/project/cubicweb-blog
.. _`cubicweb-comment`: http://www.cubicweb.org/project/cubicweb-comment
.. _`CubicWeb.org Forge`: https://forge.extranet.logilab.fr/cubicweb
.. _`cubicweb-blog`: https://forge.extranet.logilab.fr/cubicweb/cubes/blog
.. _`cubicweb-comment`: https://forge.extranet.logilab.fr/cubicweb/cubes/comment
.. _Instance:
......@@ -51,7 +51,7 @@ instances can be created and based on the same cube. For example,
several software forges can be set up on one computer system based on
the `cubicweb-forge`_ cube.
.. _`cubicweb-forge`: http://www.cubicweb.org/project/cubicweb-forge
.. _`cubicweb-forge`: https://forge.extranet.logilab.fr/cubicweb/cubes/forge
The command :command:`cubicweb-ctl list` also displays the list of instances
installed on your system.
......
......@@ -34,7 +34,7 @@ Code movement
The cubicweb.web.views.timeline module (providing the timeline-json, timeline
and static-timeline views) has moved to a standalone cube_
.. _cube: https://www.cubicweb.org/project/cubicweb-timeline
.. _cube: https://forge.extranet.logilab.fr/cubicweb/cubes/timeline
API changes
-----------
......
......@@ -48,7 +48,7 @@ Social
.. _Logilab: http://www.logilab.fr/
.. _forge: http://www.cubicweb.org/project/
.. _forge: https://forge.extranet.logilab.fr/cubicweb
.. _Python: http://www.python.org/
.. _`jabber forum`: http://www.logilab.org/blogentry/6718
.. _`mailing-list`: http://lists.cubicweb.org/mailman/listinfo/cubicweb
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment