88from email .utils import formataddr
99from email .utils import parseaddr
1010from logging import getLogger
11- from plone .api ._types import ContainerContext
11+ from plone .api ._types import Content
1212from plone .api ._types import Request
1313from plone .api .exc import CannotGetPortalError
1414from plone .api .exc import InvalidParameterError
1717from plone .registry .interfaces import IRegistry
1818from Products .CMFCore .interfaces import ISiteRoot
1919from Products .CMFCore .utils import getToolByName
20+ from Products .CMFPlone .Portal import PloneSite
2021from Products .statusmessages .interfaces import IStatusMessage
2122from typing import Any
2223from zope .component import ComponentLookupError
6061MISSING = object ()
6162
6263
63- def get () -> ContainerContext :
64+ def get () -> PloneSite :
6465 """Get the Plone portal object out of thin air.
6566
6667 Without the need to import fancy Interfaces and doing multi adapter
@@ -84,9 +85,7 @@ def get() -> ContainerContext:
8485
8586
8687@required_parameters ("context" )
87- def get_navigation_root (
88- context : ContainerContext | None = None ,
89- ) -> ContainerContext :
88+ def get_navigation_root (context : Content ) -> Content :
9089 """Get the navigation root object for the context.
9190
9291 This traverses the path up and returns the nearest navigation root.
@@ -409,7 +408,7 @@ def get_default_language() -> str:
409408 return settings .default_language
410409
411410
412- def get_current_language (context : ContainerContext | None = None ) -> str :
411+ def get_current_language (context : Content | None = None ) -> str :
413412 """Return the current negotiated language.
414413
415414 :param context: context object
@@ -458,9 +457,7 @@ def translate(msgid: str, domain: str = "plone", lang: str | None = None) -> str
458457
459458
460459@required_parameters ("name" )
461- def get_vocabulary (
462- name : str | None = None , context : ContainerContext | None = None
463- ) -> SimpleVocabulary :
460+ def get_vocabulary (name : str , context : Content | None = None ) -> SimpleVocabulary :
464461 """Return a vocabulary object with the given name.
465462
466463 :param name: Name of the vocabulary.
0 commit comments