Commit 02cf99de authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

merge 3.28.5 into 3.29

--HG--
branch : 3.29
......@@ -673,12 +673,14 @@ e731c31eaed06ac0a781db4d9a36d8b3732a4852 debian/3.27.2-1
f2e07e9cc36753c9bb21030a05a6d715aa33a289 3.27.4
7e69862f2332df296950afa7d4943471dec01986 3.27.5
7b332e2e0287182c6e9283b7debf4eb7233d3bad 3.27.6
c517d3f941b484cd0c81b81891a7d50d0ed6f10b 3.27.7
695832965852f2a8d6c767dab0f74903c962feb8 3.28.0rc1
2c0ecdfda9c46f95ef514efa0c9c06c96c98b4bd 3.28.0
4b2725c4066a0015afa66267dea3bd392235194d 3.28.1
152838b95709e95297996583a7f1a20262453970 3.28.2
0b6a5ea3950bcb3bc50b38e7d7288e3b59a7cb1a 3.28.3
f9d1400d311fb123aa5ce69a3d36742550441646 3.28.4
a20956da474443f84cee8f41e8d7e88683a4c124 3.28.5
08e8654133c1f0c44d96da36e054347c22d30c9d 3.29.0
54ddcc997e1cfb7f8701e226fb88128737898c0b 3.29.1
7ddad2aa6426aa73c09cc8232ecbe0f11bfd5d9c 3.29.2
......
# 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
......
# -*- coding: iso-8859-1 -*-
# -*- coding: utf-8 -*-
# copyright 2003 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
......
......@@ -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)
......
......@@ -22,6 +22,12 @@ cubicweb (3.29.0-1) unstable; urgency=medium
-- Laurent Peuch <cortex@worlddomination.be> Tue, 08 Dec 2020 14:51:17 +0200
cubicweb (3.28.5-1) unstable; urgency=medium
* New upstream release
-- Nicolas Chauvat <nicolas.chauvat@logilab.fr> Tue, 22 Jun 2021 22:08:18 +0200
cubicweb (3.28.4-1) unstable; urgency=medium
* New upstream release
......@@ -52,6 +58,12 @@ cubicweb (3.28.0-1) unstable; urgency=medium
-- Chabot Simon <schabot@logilab.fr> Wed, 24 Jun 2020 10:17:13 +0200
cubicweb (3.27.7-1) unstable; urgency=medium
* New upstream release
-- Nicolas Chauvat <nicolas.chauvat@logilab.fr> Tue, 22 Jun 2021 20:50:12 +0200
cubicweb (3.27.6-1) unstable; urgency=medium
* New upstream release
......
......@@ -2,10 +2,9 @@ Source: cubicweb
Section: web
Priority: optional
Maintainer: Logilab S.A. <contact@logilab.fr>
Uploaders: Sylvain Thenault <sylvain.thenault@logilab.fr>,
David Douard <david.douard@logilab.fr>,
Uploaders: Nicolas Chauvat <nicolas.chauvat@logilab.fr>,
Build-Depends:
debhelper (>= 9.20160709),
debhelper (>= 12.1.1),
dh-python,
python3-all,
python3-setuptools,
......
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