Skip to content

Commit

Permalink
fix codespell findings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Apr 12, 2023
1 parent 6752077 commit ba16e4f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ New features:


- New option ``former_dotted_names`` that allows to register the former name
under which a behavior used to be registerd. This can be useful to ensure a
under which a behavior used to be registered. This can be useful to ensure a
smooth transition in case a behavior's dotted name is changed. [pysailor]
(#18)

Expand Down
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ The directive supports the attributes:
``name``
Convenience lookup name for this behavior (optional).
The behavior will be always registered under the dotted name of ``provides`` attribute.
This are usally long names. ``name`` is a short name for this.
This are usually long names. ``name`` is a short name for this.
If ``name`` is given the behavior is registered additional under it.
Anyway using short namespaces in ``name`` is recommended.

Expand Down Expand Up @@ -189,13 +189,13 @@ ZCML Examples

Example usage, given

- some ``context`` (some arbitary object) which is ``IBehaviorAssignable``,
- an ``IMyBehavior`` interface intented to be used as ``provides``,
- an ``IMyMarker`` interface intented to be used as ``marker``,
- some ``context`` (some arbitrary object) which is ``IBehaviorAssignable``,
- an ``IMyBehavior`` interface intended to be used as ``provides``,
- an ``IMyMarker`` interface intended to be used as ``marker``,
- a ``MyFactory`` class implementing ``IMyBehavior`` ,
- a ``MySchemaAwareFactory`` class implementing ``IMyBehavior`` and ``plone.behavior.interfaces.ISchemaAwareFactory``,
- an ``IMyType`` intented to be used as ``for``.
- some ``typed_context`` (some arbitary object) which is ``IBehaviorAssignable`` and provides ``IMyType``,
- an ``IMyType`` intended to be used as ``for``.
- some ``typed_context`` (some arbitrary object) which is ``IBehaviorAssignable`` and provides ``IMyType``,
- an ``MyTypedFactory`` class implementing ``IMyBehavior`` and adapting ``IMyType``,

``title`` and ``description`` is trivial, so we dont cover it here in the explanantion.
Expand All @@ -220,7 +220,7 @@ I.e. both is done by ``plone.dexterity``.
.. warning::
Using the same Interface as marker and behavior works, but is not recommended and will be deprecated in future.
It is semantically wrong!

Go for Example 3 instead!

::
Expand Down
4 changes: 2 additions & 2 deletions plone/behavior/directives.rst
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ declaration on the factory.
>>> dummy.factory # doctest: +ELLIPSIS
<plone.behavior.annotation.AnnotationStorage object at ...>

The factory has ist ``__component_adapts__`` (``@adapter``) in place, so the adapted Interface must be returned.
The factory has it's ``__component_adapts__`` (``@adapter``) in place, so the adapted Interface must be returned.

>>> from plone.behavior.tests import IMarkerAndAdapterBehavior
>>> [a.required for a in sm.registeredAdapters() if a.provided == IMarkerAndAdapterBehavior][0]
Expand Down Expand Up @@ -327,7 +327,7 @@ declaration on the factory.
>>> dummy.factory # doctest: +ELLIPSIS
<class 'plone.behavior.tests.DummyBehaviorImpl'>

The factory has ist ``__component_adapts__`` (``@adapter``) in place, so the adapted Interface must be returned.
The factory has it's ``__component_adapts__`` (``@adapter``) in place, so the adapted Interface must be returned.

>>> from plone.behavior.tests import IMarkerAndAdapterBehavior2
>>> [a.required for a in sm.registeredAdapters() if a.provided == IMarkerAndAdapterBehavior2][0]
Expand Down
9 changes: 1 addition & 8 deletions plone/behavior/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,9 @@
from zope.component import getUtility
from zope.interface import implementer

import sys
import textwrap


if sys.version_info[0] >= 3:
text_type = str
else:
text_type = unicode


REGISTRATION_REPR = """\
<{class} {name} at {id}
schema: {identifier}
Expand Down Expand Up @@ -58,7 +51,7 @@ def __repr__(self):
"name": self.name or "(unique name not set)",
"identifier": self.interface.__identifier__,
"marker": marker_info,
"factory": text_type(self.factory),
"factory": str(self.factory),
"title": self.title or "(no title)",
"description": textwrap.fill(
self.description or "(no description)",
Expand Down

0 comments on commit ba16e4f

Please sign in to comment.