From 61480256417fbd7e7916cb79d439293be0535024 Mon Sep 17 00:00:00 2001 From: burnettk Date: Wed, 11 Oct 2023 11:58:56 -0400 Subject: [PATCH] typo --- .../bpmn/serializer/helpers/registry.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/SpiffWorkflow/bpmn/serializer/helpers/registry.py b/SpiffWorkflow/bpmn/serializer/helpers/registry.py index 9cb441b6..0c1a70a0 100644 --- a/SpiffWorkflow/bpmn/serializer/helpers/registry.py +++ b/SpiffWorkflow/bpmn/serializer/helpers/registry.py @@ -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`). @@ -41,7 +41,7 @@ def convert(self, obj): Arguments: obj: the object to preprocess and convert - + Returns: the result of `convert` conversion after preprocessing """ @@ -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 @@ -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. @@ -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""" @@ -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()) \ No newline at end of file + return dict((key_class(k), self.registry.restore(v, **kwargs)) for k, v in mapping.items())