diff --git a/requirements-docs.txt b/requirements-docs.txt index 9923bd9f..8038479c 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -1,4 +1,20 @@ +docutils<0.17,>=0.15 # sphinx-book-theme 0.2.0 has requirement docutils<0.17,>=0.15 Sphinx<5,>=3 # sphinx-book-theme 0.3.3 has requirement sphinx<5,>=3 -sphinx-book-theme<=0.3.99 +lesscpy +linkify-it-py myst-parser sphinx-autobuild +pydata-sphinx-theme<=0.8.99 +sphinx-book-theme==0.3.3 +sphinx-copybutton +sphinx-sitemap +sphinx-togglebutton +sphinxcontrib-spelling +sphinxext-opengraph +sphinxcontrib-applehelp==1.0.4 # https://github.com/plone/documentation/issues/1604 +sphinxcontrib-devhelp==1.0.2 # https://github.com/plone/documentation/issues/1604 +sphinxcontrib-htmlhelp==2.0.1 # https://github.com/plone/documentation/issues/1604 +sphinxcontrib-qthelp==1.0.3 # https://github.com/plone/documentation/issues/1604 +sphinxcontrib-serializinghtml==1.1.5 # https://github.com/plone/documentation/issues/1604 +sphinxcontrib-video +vale==2.30.0 diff --git a/src/plone/api/content.py b/src/plone/api/content.py index bd5d03d1..90f43776 100644 --- a/src/plone/api/content.py +++ b/src/plone/api/content.py @@ -11,15 +11,14 @@ from plone.uuid.interfaces import IUUID from Products.CMFCore.DynamicType import DynamicType from Products.CMFCore.WorkflowCore import WorkflowException +from zope.component import ComponentLookupError from zope.component import getMultiAdapter from zope.component import getSiteManager -from zope.component import ComponentLookupError from zope.container.interfaces import INameChooser from zope.globalrequest import getRequest from zope.interface import Interface from zope.interface import providedBy - import random import transaction @@ -527,14 +526,14 @@ def get_view(name=None, context=None, request=None): try: return getMultiAdapter((context, request), name=name) - except ComponentLookupError: - #Getting all available views + except ComponentLookupError: + # Getting all available views sm = getSiteManager() available_views = sm.adapters.lookupAll( required=(providedBy(context), providedBy(request)), provided=Interface, ) - + # Check if the requested view is available # by getting the names of all available views available_view_names = [view[0] for view in available_views] @@ -549,6 +548,7 @@ def get_view(name=None, context=None, request=None): ), ) + @required_parameters("obj") def get_uuid(obj=None): """Get the object's Universally Unique IDentifier (UUID). diff --git a/src/plone/api/relation.py b/src/plone/api/relation.py index 60df78ef..5540d4ca 100644 --- a/src/plone/api/relation.py +++ b/src/plone/api/relation.py @@ -2,6 +2,7 @@ Heavily inspired by collective.relationhelpers. """ + from AccessControl.SecurityManagement import getSecurityManager from collections import defaultdict from plone.api.exc import InvalidParameterError diff --git a/src/plone/api/tests/test_content.py b/src/plone/api/tests/test_content.py index 7123667c..08ab2141 100644 --- a/src/plone/api/tests/test_content.py +++ b/src/plone/api/tests/test_content.py @@ -1,4 +1,5 @@ """Tests for plone.api.content.""" + from Acquisition import aq_base from OFS.CopySupport import CopyError from OFS.event import ObjectWillBeMovedEvent