inspect

class platypush.plugins.inspect.ActionModel(action, html_doc: bool = False)[source]

Bases: Model

__init__(action, html_doc: bool = False)[source]
class platypush.plugins.inspect.BackendModel(backend, prefix='', html_doc: Optional[bool] = False)[source]

Bases: Model

__init__(backend, prefix='', html_doc: Optional[bool] = False)[source]
class platypush.plugins.inspect.EventModel(event, prefix='', html_doc: Optional[bool] = False)[source]

Bases: Model

__init__(event, prefix='', html_doc: Optional[bool] = False)[source]
class platypush.plugins.inspect.InspectPlugin(**kwargs)[source]

Bases: Plugin

This plugin can be used to inspect platypush plugins and backends

Requires:

  • docutils (pip install docutils) - optional, for HTML doc generation

__init__(**kwargs)[source]
get_all_backends(html_doc: Optional[bool] = None)[source]
Parameters:

html_doc – If True then the docstring will be parsed into HTML (default: False)

get_all_events(html_doc: Optional[bool] = None)[source]
Parameters:

html_doc – If True then the docstring will be parsed into HTML (default: False)

get_all_plugins(html_doc: Optional[bool] = None)[source]
Parameters:

html_doc – If True then the docstring will be parsed into HTML (default: False)

get_all_responses(html_doc: Optional[bool] = None)[source]
Parameters:

html_doc – If True then the docstring will be parsed into HTML (default: False)

get_config(entry: Optional[str] = None) Optional[dict][source]

Return the configuration of the application or of a section.

Parameters:

entry – [Optional] configuration entry name to retrieve (e.g. workdir or backend.http).

Returns:

The requested configuration object.

get_procedures() dict[source]

Get the list of procedures installed on the device.

class platypush.plugins.inspect.Model[source]

Bases: ABC

class platypush.plugins.inspect.PluginModel(plugin, prefix='', html_doc: Optional[bool] = False)[source]

Bases: Model

__init__(plugin, prefix='', html_doc: Optional[bool] = False)[source]
class platypush.plugins.inspect.ProcedureEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: JSONEncoder

default(o)[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
class platypush.plugins.inspect.ResponseModel(response, prefix='', html_doc: Optional[bool] = False)[source]

Bases: Model

__init__(response, prefix='', html_doc: Optional[bool] = False)[source]