Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
burnettk committed Oct 11, 2023
1 parent 9bf0760 commit 6148025
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions SpiffWorkflow/bpmn/serializer/helpers/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
from .dictionary import DictionaryConverter

class DefaultRegistry(DictionaryConverter):
"""This class forms the basis of serialization for BPMN workflows.
"""This class forms the basis of serialization for BPMN workflows.
It contains serialization rules for a few python data types that are not JSON serializable by default which
are used internally by Spiff. It can be instantiated and customized to handle arbitrary task or workflow
data as well (see `dictionary.DictionaryConverter`).
Expand All @@ -41,7 +41,7 @@ def convert(self, obj):
Arguments:
obj: the object to preprocess and convert
Returns:
the result of `convert` conversion after preprocessing
"""
Expand All @@ -68,8 +68,8 @@ def clean(self, obj):
class BpmnConverter:
"""The base class for conversion of BPMN classes.
In general, most classes that extend this would simply take an existing registry as an argument
nd supply the class along with the implementations of the conversion functions `to_dict` and
In general, most classes that extend this would simply take an existing registry as an argument
and supply the class along with the implementations of the conversion functions `to_dict` and
`from_dict`.
The operation of the converter is a little opaque, but hopefully makes sense with a little
Expand All @@ -85,7 +85,7 @@ class BpmnConverter:
The goal is to be able to replace the conversion mechanism for a particular entity without
delving into the details of other things spiff knows about.
So for example, it is not necessary to re-implemnent any of the event-based task spec conversions
because, eg, the `MessageEventDefintion` was modified; the existing `MessageEventDefinitionConverter`
can be replaced with a customized one and it will automatically be used with any event-based task.
Expand All @@ -100,8 +100,8 @@ def __init__(self, target_class, registry, typename=None):
"""
self.target_class = target_class
self.registry = registry
self.typename = typename if typename is not None else target_class.__name__
self.registry.register(target_class, self.to_dict, self.from_dict, self.typename)
self.typename = typename if typename is not None else target_class.__name__
self.registry.register(target_class, self.to_dict, self.from_dict, self.typename)

def to_dict(self, spec):
"""This method should take an object and convert it to a dictionary that is JSON-serializable"""
Expand All @@ -120,4 +120,4 @@ def mapping_from_dict(self, mapping, key_class=None, **kwargs):
if key_class is None:
return dict((k, self.registry.restore(v, **kwargs)) for k, v in mapping.items())
else:
return dict((key_class(k), self.registry.restore(v, **kwargs)) for k, v in mapping.items())
return dict((key_class(k), self.registry.restore(v, **kwargs)) for k, v in mapping.items())

0 comments on commit 6148025

Please sign in to comment.