Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubicweb
Commits
96d434727612
Commit
20e5fd18
authored
Jun 24, 2021
by
Nicolas Chauvat
Browse files
fix previous merges
--HG-- branch : 3.30
parent
cc18c06fe5e4
Pipeline
#64123
passed with stages
in 31 minutes and 27 seconds
Changes
16
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
cubicweb/devtools/stresstester.py
View file @
96d43472
...
...
@@ -50,6 +50,8 @@ from getpass import getpass
from
os.path
import
basename
from
time
import
clock
from
six.moves
import
input
from
logilab.common.fileutils
import
lines
from
logilab.common.ureports
import
Table
,
TextWriter
...
...
@@ -162,7 +164,7 @@ def run(args):
usage
(
1
)
queries
=
[
query
for
query
in
lines
(
args
[
1
])
if
not
query
.
startswith
(
'#'
)]
if
user
is
None
:
user
=
raw_
input
(
'login: '
)
user
=
input
(
'login: '
)
if
password
is
None
:
password
=
getpass
(
'password: '
)
from
cubicweb.cwconfig
import
instance_configuration
...
...
cubicweb/devtools/test/unittest_devctl.py
View file @
96d43472
...
...
@@ -47,7 +47,8 @@ class DevCtlTC(TestCase):
expected_project_content
=
[
'setup.py'
,
'test'
,
'MANIFEST.in'
,
'cubicweb_foo'
,
'cubicweb-foo.spec'
,
'debian'
,
'README'
,
'tox.ini'
,
'.gitlab-ci.yml'
]
'tox.ini'
,
'.gitlab-ci.yml'
,
'.hgignore'
]
expected_package_content
=
[
'i18n'
,
'hooks.py'
,
'views.py'
,
'migration'
,
'entities.py'
,
'schema.py'
,
'__init__.py'
,
'data'
,
'__pkginfo__.py'
]
...
...
cubicweb/devtools/webtest.py
View file @
96d43472
from
__future__
import
absolute_import
import
webtest
from
cubicweb.wsgi
import
handler
...
...
cubicweb/misc/migration/3.22.0_Any.py
View file @
96d43472
...
...
@@ -3,7 +3,7 @@ if confirm('use Europe/Paris as timezone?'):
else
:
import
pytz
while
True
:
timezone
=
raw_
input
(
'enter your timezone'
)
timezone
=
input
(
'enter your timezone'
)
if
timezone
in
pytz
.
common_timezones
:
break
...
...
cubicweb/misc/scripts/chpasswd.py
View file @
96d43472
...
...
@@ -26,7 +26,7 @@ from cubicweb.server.utils import crypt_password
if
__args__
:
login
=
__args__
.
pop
()
else
:
login
=
raw_
input
(
"login? "
)
login
=
input
(
"login? "
)
rset
=
rql
(
'Any U WHERE U is CWUser, U login %(login)s'
,
{
'login'
:
login
})
...
...
cubicweb/misc/scripts/ldap_change_base_dn.py
View file @
96d43472
from
__future__
import
print_function
from
base64
import
b64decode
,
b64encode
try
:
uri
,
newdn
=
__args__
...
...
@@ -12,7 +10,7 @@ olddn = repo.source_by_uri(uri).config['user-base-dn']
assert
olddn
!=
newdn
raw_
input
(
"Ensure you've stopped the instance, type enter when done."
)
input
(
"Ensure you've stopped the instance, type enter when done."
)
for
eid
,
olduserdn
in
rql
(
"Any X, XURI WHERE X cwuri XURI, X cw_source S, S name %(name)s"
,
{
'name'
:
uri
}):
...
...
cubicweb/server/schemaserial.py
View file @
96d43472
...
...
@@ -54,7 +54,7 @@ def group_mapping(cnx, interactive=True):
print
(
'or just type enter to skip permissions granted to a group'
)
for
group
in
missing
:
while
True
:
value
=
raw_
input
(
'eid for group %s: '
%
group
).
strip
()
value
=
input
(
'eid for group %s: '
%
group
).
strip
()
if
not
value
:
continue
try
:
...
...
cubicweb/skeleton/.hgignore.tmpl
0 → 100644
View file @
96d43472
syntax: glob
*~
#*
*.bak
*.old
*.pyo
*.pyc
*.cache
*.swp
*.swo
*.mo
*.lock
*.sqlite
__pycache__
*.egg-info
.tox/
.pybuild
.cache
.coverage
.pytest-cache
build/
dist/
node_modules/
.mypy_cache/
debian/*.log
debian/*.substvars
debian/files
test/data/database/
test/data/ldapdb/
test/data/uicache/
docs/_build
cubicweb/utils.py
View file @
96d43472
...
...
@@ -17,8 +17,6 @@
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""Some utilities for CubicWeb server/clients."""
from
__future__
import
division
import
base64
import
decimal
import
datetime
...
...
cubicweb/web/views/autoform.py
View file @
96d43472
# copyright 2003 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# contact http
s
://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 <http
s
://www.gnu.org/licenses/>.
"""
.. autoclass:: AutomaticEntityForm
...
...
@@ -730,10 +730,13 @@ class UnrelatedDivs(EntityView):
mode
=
'%s:%s:%s:%s'
%
(
role
,
entity
.
eid
,
rschema
.
type
,
eschema
)
url
=
self
.
_cw
.
build_url
(
entity
.
rest_path
(),
vid
=
'search-associate'
,
__mode
=
mode
)
options
.
append
((
eschema
.
display_name
(
self
.
_cw
),
'<option value="%s">%s %s</option>'
%
(
xml_escape
(
url
),
_
(
'Search for'
),
eschema
.
display_name
(
self
.
_cw
))))
return
[
option
for
_name
,
option
in
sorted
(
options
)]
options
.
append
(
(
eschema
.
display_name
(
self
.
_cw
),
'<option value="%s">%s %s</option>'
%
(
xml_escape
(
url
),
_
(
'Search for'
),
eschema
.
display_name
(
self
.
_cw
))))
return
[
option
for
name
,
option
in
sorted
(
options
)]
# The automatic entity form ####################################################
...
...
debian/control
View file @
96d43472
...
...
@@ -30,7 +30,7 @@ Build-Depends:
sphinx-common,
Standards-Version: 4.3.0
Homepage: https://www.cubicweb.org
X-Python3-Version: >= 3.
6
X-Python3-Version: >= 3.
7
Package: python3-cubicweb
...
...
doc/book/annexes/faq.rst
View file @
96d43472
...
...
@@ -271,7 +271,7 @@ How to import LDAP users in |cubicweb| ?
print 'USAGE: python ldap2system.py <database>'
sys.exit(1)
if
raw_
input('update %s db ? [y/n]: ' % database).strip().lower().startswith('y'):
if input('update %s db ? [y/n]: ' % database).strip().lower().startswith('y'):
cnx = get_connection(user=getlogin(), database=database)
cursor = cnx.cursor()
...
...
doc/book/devrepo/datamodel/definition.rst
View file @
96d43472
...
...
@@ -478,8 +478,8 @@ simplify greatly complex security definition and upgrade.
class my_relation(RelationDefinition):
__permissions__ = {'read': ('managers', 'users'),
'add': ('managers', RRQLExpression('U has_update_permission S')),
'delete': ('managers', RRQLExpression('U has_update_permission S'))
}
'delete': ('managers', RRQLExpression('U has_update_permission S'))
,
}
In the above example, user will be allowed to add/delete `my_relation` if he has
the `update` permission on the subject of the relation.
...
...
doc/tools/mode_plan.py
View file @
96d43472
...
...
@@ -28,7 +28,7 @@ def ren(a,b):
names
=
glob
.
glob
(
'%s*'
%
a
)
for
name
in
names
:
print
(
'rename %s to %s'
%
(
name
,
name
.
replace
(
a
,
b
)))
if
raw_
input
(
'accept [y/N]?'
).
lower
()
==
'y'
:
if
input
(
'accept [y/N]?'
).
lower
()
==
'y'
:
for
name
in
names
:
os
.
system
(
'hg mv %s %s'
%
(
name
,
name
.
replace
(
a
,
b
)))
...
...
doc/tutorials/advanced/part02_security.rst
View file @
96d43472
...
...
@@ -123,19 +123,19 @@ attribute and relation. Here is the code to add to :file:`schema.py`:
'add': ('managers',),
'update': ('managers', 'owners',),
'delete': ('managers', 'owners'),
}
}
AUTH_ONLY_PERMISSIONS = {
'read': ('managers', 'users'),
'add': ('managers',),
'update': ('managers', 'owners',),
'delete': ('managers', 'owners'),
}
}
CLASSIFIERS_PERMISSIONS = {
'read': ('managers', 'users', 'guests'),
'add': ('managers',),
'update': ('managers', 'owners',),
'delete': ('managers', 'owners'),
}
}
from cubicweb_folder.schema import Folder
from cubicweb_file.schema import File
...
...
setup.py
View file @
96d43472
...
...
@@ -68,7 +68,7 @@ setup(
'rql >= 0.36.1'
,
'yams >= 0.45.3'
,
'lxml'
,
'logilab-database >= 1.17.2,
<
1.18.0'
,
'logilab-database >= 1.17.2,
<
1.18.0'
,
'passlib >= 1.7'
,
'pytz'
,
'Markdown'
,
...
...
@@ -76,7 +76,7 @@ setup(
'filelock'
,
'rdflib'
,
'rdflib-jsonld'
,
'pyramid >= 1.5.0,<2'
,
'pyramid >= 1.5.0,<2
.0.0
'
,
'waitress >= 0.8.9'
,
'wsgicors >= 0.3'
,
'pyramid_multiauth'
,
...
...
@@ -115,3 +115,4 @@ setup(
zip_safe
=
False
,
python_requires
=
">=3.6"
,
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment