Options

This mixin adds functionality for easy configuration of complex objects.

The Options mixin introduces an instanceOptions property which holds a dict of all sorts of configuration options. It also includes utility code for the merging of these options. This mixin requires you to write a static defaultoptions method.

class rtd.util.mixins.Options.Options[source]

Bases: object

The Options mixin introduces an instanceOptions property which holds a dict of all sorts of configuration options. It also includes utility code for the merging of these dicts. This mixin requires you to write a static defaultoptions method

abstract static defaultoptions() dict[source]

Abstract static method which needs to be implemented to provide the default options for any given class. Should return a dict

getoptions() dict[source]

Returns a copy of the current instanceOptions

Returns:

option – copy of the current option

Return type:

dict

mergeoptions(*newOptions: dict) dict[source]

Takes in any number of options and updates the current instanceOptions. Returns a copy of the updated instanceOptions

Parameters:

newOptions (dict) – option(s) to merge with

Returns:

option – copy of merged options

Return type:

dict