Permalink
Browse files

Fix spelling of 'serializable' (#144)

* Fix spelling of 'serializable'
* Add registration to remap misspelled class to correct spelling in OTIO files that already exist
  • Loading branch information...
Alex Widener authored and jminor committed Aug 10, 2017
1 parent cbab7d7 commit 83bfb7795113a68c3dcbe7067bf0c761a3229a83
Showing with 170 additions and 164 deletions.
  1. +1 −1 bin/otioview.py
  2. +2 −2 doc/source/opentimelineio.core.rst
  3. +2 −2 opentimelineio/adapters/adapter.py
  4. +2 −2 opentimelineio/adapters/fcp_xml.py
  5. +4 −4 opentimelineio/core/__init__.py
  6. +6 −6 opentimelineio/core/composable.py
  7. +4 −4 opentimelineio/core/composition.py
  8. +8 −8 opentimelineio/core/item.py
  9. +14 −14 opentimelineio/core/json_serializer.py
  10. +21 −21 opentimelineio/core/{serializeable_object.py → serializable_object.py}
  11. +2 −2 opentimelineio/core/type_registry.py
  12. +1 −1 opentimelineio/exceptions.py
  13. +1 −1 opentimelineio/media_linker.py
  14. +9 −9 opentimelineio/media_reference.py
  15. +5 −5 opentimelineio/plugins/manifest.py
  16. +6 −6 opentimelineio/plugins/python_plugin.py
  17. +2 −2 opentimelineio/schema/__init__.py
  18. +3 −3 opentimelineio/schema/clip.py
  19. +6 −6 opentimelineio/schema/effect.py
  20. +1 −1 opentimelineio/schema/gap.py
  21. +7 −7 opentimelineio/schema/marker.py
  22. +2 −2 opentimelineio/schema/sequence.py
  23. +21 −15 opentimelineio/schema/{serializeable_collection.py → serializable_collection.py}
  24. +1 −1 opentimelineio/schema/stack.py
  25. +6 −6 opentimelineio/schema/timeline.py
  26. +5 −5 opentimelineio/schema/transition.py
  27. +2 −2 opentimelineview/timeline_widget.py
  28. +1 −1 tests/baselines/{empty_serializeable_collection.json → empty_serializable_collection.json}
  29. +1 −1 tests/test_item.py
  30. +3 −3 tests/test_json_backend.py
  31. +4 −4 tests/{test_serializeable_collection.py → test_serializable_collection.py}
  32. +17 −17 tests/{test_serializeable_object.py → test_serializable_object.py}
View
@@ -138,7 +138,7 @@ def load(self, path):
self.sequences_widget.setVisible(False)
elif isinstance(
file_contents,
otio.schema.SerializeableCollection
otio.schema.SerializableCollection
):
for s in file_contents:
TimelineWidgetItem(s, s.name, self.sequences_widget)
@@ -20,10 +20,10 @@ opentimelineio.core.item module
:undoc-members:
:show-inheritance:
opentimelineio.core.serializeable_object module
opentimelineio.core.serializable_object module
-----------------------------------------------
.. automodule:: opentimelineio.core.serializeable_object
.. automodule:: opentimelineio.core.serializable_object
:members:
:undoc-members:
:show-inheritance:
@@ -54,7 +54,7 @@ class Adapter(plugins.PythonPlugin):
For more information:
https://github.com/PixarAnimationStudios/OpenTimelineIO/wiki/How-to-Write-an-OpenTimelineIO-Adapter # noqa
"""
_serializeable_label = "Adapter.1"
_serializable_label = "Adapter.1"
def __init__(
self,
@@ -74,7 +74,7 @@ def __init__(
suffixes = []
self.suffixes = suffixes
suffixes = core.serializeable_field(
suffixes = core.serializable_field(
"suffixes",
type([]),
doc="File suffixes associated with this adapter."
@@ -502,7 +502,7 @@ def _parse_timeline(sequence, element_map):
def _parse_collection(sequences, element_map):
collection = otio.schema.SerializeableCollection(name='sequences')
collection = otio.schema.SerializableCollection(name='sequences')
collection.extend([_parse_timeline(s, element_map) for s in sequences])
return collection
@@ -925,7 +925,7 @@ def write_to_string(input_otio):
children_e.append(
_build_sequence(input_otio.tracks, timeline_range, br_map)
)
elif isinstance(input_otio, otio.schema.SerializeableCollection):
elif isinstance(input_otio, otio.schema.SerializableCollection):
children_e.extend(
_build_collection(input_otio, br_map)
)
@@ -26,10 +26,10 @@
# flake8: noqa
from . import serializeable_object
from .serializeable_object import (
SerializeableObject,
serializeable_field,
from . import serializable_object
from .serializable_object import (
SerializableObject,
serializable_field,
deprecated_field,
)
from .composable import (
@@ -27,36 +27,36 @@
An object that can be composed by sequences.
"""
from . import serializeable_object
from . import serializable_object
from . import type_registry
@type_registry.register_type
class Composable(serializeable_object.SerializeableObject):
class Composable(serializable_object.SerializableObject):
"""An object that can be composed by sequences.
Base class of:
Item
Transition
"""
name = serializeable_object.serializeable_field(
name = serializable_object.serializable_field(
"name",
doc="Composable name."
)
metadata = serializeable_object.serializeable_field(
metadata = serializable_object.serializable_field(
"metadata",
doc="Metadata dictionary for this Composable."
)
_serializeable_label = "Composable.1"
_serializable_label = "Composable.1"
_class_path = "core.Composable"
def __init__(self, name=None, metadata=None):
super(Composable, self).__init__()
self._parent = None
# initialize the serializeable fields
# initialize the serializable fields
self.name = name
if metadata is None:
@@ -27,7 +27,7 @@
import collections
from . import (
serializeable_object,
serializable_object,
type_registry,
item,
composable,
@@ -47,7 +47,7 @@ class Composition(item.Item, collections.MutableSequence):
directly.
"""
_serializeable_label = "Composition.1"
_serializable_label = "Composition.1"
_composition_kind = "Composition"
_modname = "core"
_composable_base_class = composable.Composable
@@ -73,7 +73,7 @@ def __init__(
# extra logic (assigning ._parent pointers).
self.extend(children)
_children = serializeable_object.serializeable_field(
_children = serializable_object.serializable_field(
"children",
list,
"Items contained by this composition."
@@ -111,7 +111,7 @@ def __repr__(self):
)
)
transform = serializeable_object.deprecated_field()
transform = serializable_object.deprecated_field()
def each_child(
self,
@@ -29,7 +29,7 @@
)
from . import (
serializeable_object,
serializable_object,
composable,
)
@@ -47,7 +47,7 @@ class Item(composable.Composable):
- Gap
"""
_serializeable_label = "Item.1"
_serializable_label = "Item.1"
_class_path = "core.Item"
def __init__(
@@ -58,7 +58,7 @@ def __init__(
markers=None,
metadata=None,
):
serializeable_object.SerializeableObject.__init__(self)
serializable_object.SerializableObject.__init__(self)
self.name = name
self.source_range = source_range
@@ -77,8 +77,8 @@ def __init__(
self._parent = None
name = serializeable_object.serializeable_field("name", doc="Item name.")
source_range = serializeable_object.serializeable_field(
name = serializable_object.serializable_field("name", doc="Item name.")
source_range = serializable_object.serializable_field(
"source_range",
opentime.TimeRange,
doc="Range of source to trim to. Can be None or a TimeRange."
@@ -170,15 +170,15 @@ def transformed_time_range(self, tr, to_item):
tr.duration
)
markers = serializeable_object.serializeable_field(
markers = serializable_object.serializable_field(
"markers",
doc="List of markers on this item."
)
effects = serializeable_object.serializeable_field(
effects = serializable_object.serializable_field(
"effects",
doc="List of effects on this item."
)
metadata = serializeable_object.serializeable_field(
metadata = serializable_object.serializable_field(
"metadata",
doc="Metadata dictionary for this item."
)
@@ -22,15 +22,15 @@
# language governing permissions and limitations under the Apache License.
#
"""Serializer for SerializeableObjects to JSON
"""Serializer for SerializableObjects to JSON
Used for the otio_json adapter as well as for plugins and manifests.
"""
import json
from . import (
SerializeableObject,
SerializableObject,
type_registry,
)
@@ -43,9 +43,9 @@
# @TODO: Handle file version drifting
class _SerializeableObjectEncoder(json.JSONEncoder):
class _SerializableObjectEncoder(json.JSONEncoder):
""" Encoder for the SerializeableObject OTIO Class and its descendents. """
""" Encoder for the SerializableObject OTIO Class and its descendents. """
def default(self, obj):
for typename, encfn in _ENCODER_MAP.items():
@@ -56,20 +56,20 @@ def default(self, obj):
def serialize_json_to_string(root, sort_keys=True, indent=4):
"""Serialize a tree of SerializeableObject to JSON.
"""Serialize a tree of SerializableObject to JSON.
Returns a JSON string.
"""
return _SerializeableObjectEncoder(
return _SerializableObjectEncoder(
sort_keys=sort_keys,
indent=indent
).encode(root)
def serialize_json_to_file(root, to_file):
"""
Serialize a tree of SerializeableObject to JSON.
Serialize a tree of SerializableObject to JSON.
Writes the result to the given file path.
"""
@@ -82,13 +82,13 @@ def serialize_json_to_file(root, to_file):
# @{ Encoders
def _encoded_serializeable_object(input_otio):
if not input_otio._serializeable_label:
raise exceptions.InvalidSerializeableLabelError(
input_otio._serializeable_label
def _encoded_serializable_object(input_otio):
if not input_otio._serializable_label:
raise exceptions.InvalidSerializableLabelError(
input_otio._serializable_label
)
result = {
"OTIO_SCHEMA": input_otio._serializeable_label,
"OTIO_SCHEMA": input_otio._serializable_label,
}
result.update(input_otio.data)
return result
@@ -125,7 +125,7 @@ def _encoded_transform(input_otio):
opentime.RationalTime: _encoded_time,
opentime.TimeRange: _encoded_time_range,
opentime.TimeTransform: _encoded_transform,
SerializeableObject: _encoded_serializeable_object,
SerializableObject: _encoded_serializable_object,
}
# @{ Decoders
@@ -155,7 +155,7 @@ def _decoded_transform(input_otio):
# Map of explicit decoder functions to schema labels (for opentime)
# because opentime is implemented with no knowledge of OTIO, it doesn't use the
# same pattern as SerializeableObject.
# same pattern as SerializableObject.
_DECODER_FUNCTION_MAP = {
'RationalTime.1': _decoded_time,
'TimeRange.1': _decoded_time_range,
Oops, something went wrong.

0 comments on commit 83bfb77

Please sign in to comment.