Commit 2a0f1117 authored by Nicolas Chauvat's avatar Nicolas Chauvat

chore: paint it black

parent 01842a5b46d1
Pipeline #37399 failed with stage
in 8 minutes and 40 seconds
add_relation_definition('Blog', 'see_also', 'Blog')
add_relation_definition("Blog", "see_also", "Blog")
add_relation_definition('Card', 'see_also', 'File')
add_relation_definition('Blog', 'see_also', 'File')
add_relation_definition('File', 'see_also', 'File')
add_relation_definition('Card', 'see_also', 'Link')
add_relation_definition('Blog', 'see_also', 'Link')
add_relation_definition('File', 'see_also', 'Link')
add_relation_definition('Link', 'see_also', 'Link')
add_relation_definition("Card", "see_also", "File")
add_relation_definition("Blog", "see_also", "File")
add_relation_definition("File", "see_also", "File")
add_relation_definition("Card", "see_also", "Link")
add_relation_definition("Blog", "see_also", "Link")
add_relation_definition("File", "see_also", "Link")
add_relation_definition("Link", "see_also", "Link")
synchronize_permissions('Blog')
synchronize_permissions('Card')
synchronize_permissions('File')
synchronize_permissions('Link')
synchronize_permissions("Blog")
synchronize_permissions("Card")
synchronize_permissions("File")
synchronize_permissions("Link")
rql('SET X see_also Y WHERE X concerns Y')
rql("SET X see_also Y WHERE X concerns Y")
drop_relation_type('concerns')
drop_relation_type("concerns")
synchronize_permissions("Blog")
synchronize_permissions("Card")
synchronize_permissions("File")
synchronize_permissions("Link")
synchronize_permissions('Blog')
synchronize_permissions('Card')
synchronize_permissions('File')
synchronize_permissions('Link')
add_relation_definition('Comment', 'comments', 'Card')
add_relation_definition("Comment", "comments", "Card")
# add missing see_also relation definitions
see_also_schema = schema.rschema('see_also')
see_also_schema = schema.rschema("see_also")
if 'Versionedfile' in schema:
for ttype in ('Card', 'Blog', 'File', 'Image', 'Link', 'Versionedfile'):
if not see_also_schema.has_rdef('Versionedfile', ttype):
add_relation_definition('Versionedfile', 'see_also', ttype)
if "Versionedfile" in schema:
for ttype in ("Card", "Blog", "File", "Image", "Link", "Versionedfile"):
if not see_also_schema.has_rdef("Versionedfile", ttype):
add_relation_definition("Versionedfile", "see_also", ttype)
for ttype in ('Card', 'Blog', 'File', 'Image', 'Link'):
if not see_also_schema.has_rdef('Image', ttype):
add_relation_definition('Image', 'see_also', ttype)
for ttype in ("Card", "Blog", "File", "Image", "Link"):
if not see_also_schema.has_rdef("Image", ttype):
add_relation_definition("Image", "see_also", ttype)
remove_cube('basket')
remove_cube("basket")
add_relation_definition('Comment', 'comments', 'BlogEntry')
drop_relation_definition('Comment', 'comments', 'Blog')
add_relation_definition("Comment", "comments", "BlogEntry")
drop_relation_definition("Comment", "comments", "Blog")
add_relation_definition('Comment', 'comments', 'Book')
add_relation_definition('Tag', 'tags', 'Book')
add_relation_definition("Comment", "comments", "Book")
add_relation_definition("Tag", "tags", "Book")
drop_cube('vcsfile')
drop_cube("vcsfile")
drop_cube('trustedauth')
drop_cube("trustedauth")
......@@ -15,11 +15,25 @@ from cubicweb_file.schema import File
from cubicweb_link.schema import Link
PERMISSIONS = {
'read': ('managers', 'users', 'guests',),
'add': ('managers', 'users',),
'delete': ('managers', 'owners',),
'update': ('managers', 'users', 'owners',),
}
"read": (
"managers",
"users",
"guests",
),
"add": (
"managers",
"users",
),
"delete": (
"managers",
"owners",
),
"update": (
"managers",
"users",
"owners",
),
}
Card.__permissions__ = PERMISSIONS
BlogEntry.__permissions__ = PERMISSIONS
......@@ -28,16 +42,17 @@ Link.__permissions__ = PERMISSIONS
class interested_in(RelationDefinition):
subject = 'CWUser'
object = 'Event'
subject = "CWUser"
object = "Event"
BASETYPES = ('Card', 'BlogEntry', 'File', 'Event', 'Link', 'Task', 'Book')
if 'VersionedFile' in context.defined:
BASETYPES += ('VersionedFile',)
BASETYPES = ("Card", "BlogEntry", "File", "Event", "Link", "Task", "Book")
if "VersionedFile" in context.defined:
BASETYPES += ("VersionedFile",)
from cubicweb_vcsfile.schema import VersionedFile, VersionContent
VersionedFile.get_relation('name').fulltextindexed = True
VersionContent.get_relation('data').fulltextindexed = True
VersionedFile.get_relation("name").fulltextindexed = True
VersionContent.get_relation("data").fulltextindexed = True
class see_also(RelationDefinition):
......@@ -46,10 +61,10 @@ class see_also(RelationDefinition):
class comments(RelationDefinition):
subject = 'Comment'
subject = "Comment"
object = BASETYPES
class tags(RelationDefinition):
subject = 'Tag'
subject = "Tag"
object = BASETYPES
......@@ -11,4 +11,6 @@ from cubicweb.predicates import is_instance
from cubicweb_tag.views import TagsCloudBox
TagsCloudBox.visible = True
TagsCloudBox.__select__ = TagsCloudBox.__select__ & is_instance('BlogEntry', 'Link', 'Card', 'File')
TagsCloudBox.__select__ = TagsCloudBox.__select__ & is_instance(
"BlogEntry", "Link", "Card", "File"
)
......@@ -30,34 +30,35 @@ here = dirname(__file__)
# load metadata from the __pkginfo__.py file so there is no risk of conflict
# see https://packaging.python.org/en/latest/single_source_version.html
pkginfo = join(here, 'cubicweb_intranet', '__pkginfo__.py')
pkginfo = join(here, "cubicweb_intranet", "__pkginfo__.py")
__pkginfo__ = {}
with open(pkginfo) as f:
exec(f.read(), __pkginfo__)
# get required metadatas
distname = __pkginfo__['distname']
version = __pkginfo__['version']
license = __pkginfo__['license']
description = __pkginfo__['description']
web = __pkginfo__['web']
author = __pkginfo__['author']
author_email = __pkginfo__['author_email']
classifiers = __pkginfo__['classifiers']
distname = __pkginfo__["distname"]
version = __pkginfo__["version"]
license = __pkginfo__["license"]
description = __pkginfo__["description"]
web = __pkginfo__["web"]
author = __pkginfo__["author"]
author_email = __pkginfo__["author_email"]
classifiers = __pkginfo__["classifiers"]
with open(join(here, 'README.rst')) as f:
with open(join(here, "README.rst")) as f:
long_description = f.read()
# get optional metadatas
data_files = __pkginfo__.get('data_files', None)
dependency_links = __pkginfo__.get('dependency_links', ())
data_files = __pkginfo__.get("data_files", None)
dependency_links = __pkginfo__.get("dependency_links", ())
requires = {}
for entry in ("__depends__",): # "__recommends__"):
requires.update(__pkginfo__.get(entry, {}))
install_requires = ["{0} {1}".format(d, v and v or "").strip()
for d, v in requires.items()]
install_requires = [
"{0} {1}".format(d, v and v or "").strip() for d, v in requires.items()
]
setup(
......@@ -70,14 +71,14 @@ setup(
author_email=author_email,
url=web,
classifiers=classifiers,
packages=find_packages(exclude=['test']),
packages=find_packages(exclude=["test"]),
install_requires=install_requires,
include_package_data=True,
entry_points={
'cubicweb.cubes': [
'intranet=cubicweb_intranet',
"cubicweb.cubes": [
"intranet=cubicweb_intranet",
],
},
python_requires='>=3',
python_requires=">=3",
zip_safe=False,
)
......@@ -10,7 +10,7 @@ class AutomaticWebTest(AutomaticWebTest):
def random_numbers(size):
return u''.join(random.choice('0123456789') for i in range(size))
return u"".join(random.choice("0123456789") for i in range(size))
class MyValueGenerator(ValueGenerator):
......@@ -21,6 +21,7 @@ class MyValueGenerator(ValueGenerator):
return random_numbers(13)
if __name__ == '__main__':
if __name__ == "__main__":
import unittest
unittest.main()
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