yuuno.core.registry module

class yuuno.core.registry.Registry(*args, **kwargs)[source]

Bases: traitlets.traitlets.HasTraits

Stores which Clip-Type is responsible for wrapping specific applications.

add_subregistry(registry: yuuno.core.registry.Registry) → None[source]

Adds a subregistry to the registry.

These registries can be removed at any time.

Parameters:registry – The registry to add
all_types() → typing.Iterator[typing.Type][source]

A generator that returns all supported types.


An instance of a Python dict.

get_clip_type_for(item: T) → typing.Union[typing.Type[yuuno.clip.Clip], NoneType][source]

Returns the clip type for the given object.

Parameters:item – The clip to convert.
Returns:Type clip-type responsible for wrapping the object
register(base: typing.Type[yuuno.clip.Clip], type: typing.Type[T] = None) → typing.Union[typing.Callable[[typing.Type[yuuno.clip.Clip]], typing.Type[yuuno.clip.Clip]], NoneType][source]

Registers a new clip type for the given clip.

  • base – The clip-type
  • type – The type the clip is wrapping. (If omitted it will represent a decorator)

A decorator or none.

remove_subregistry(registry: yuuno.core.registry.Registry) → None[source]

Removes a subregistry from the registry.

Parameters:registry – The registry to remove.

An instance of a Python list.

wrap(item: T) → yuuno.clip.Clip[source]

Returns a wrapper for the clip type.

Parameters:item – The item to convert.
Returns:The clip wrapping the item.