Commit 20e5fd18 authored by Nicolas Chauvat's avatar Nicolas Chauvat
Browse files

fix previous merges

--HG--
branch : 3.30
parent cc18c06fe5e4
Pipeline #64123 passed with stages
in 31 minutes and 27 seconds
......@@ -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
......
......@@ -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']
......
from __future__ import absolute_import
import webtest
from cubicweb.wsgi import handler
......
......@@ -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
......
......@@ -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})
......
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}):
......
......@@ -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:
......
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
......@@ -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
......
# copyright 2003 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
# 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/>.
"""
.. 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 ####################################################
......
......@@ -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
......
......@@ -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()
......
......@@ -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.
......
......@@ -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)))
......
......@@ -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
......
......@@ -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",
)
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