platypush.plugins.inspect

class platypush.plugins.inspect.InspectPlugin(**kwargs)[source]

This plugin can be used to inspect platypush plugins and backends

Requires:

  • docutils (pip install docutils) - optional, for HTML doc generation
__init__(**kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.

get_all_backends(html_doc: bool = None)[source]
Parameters:html_doc – If True then the docstring will be parsed into HTML (default: False)
get_all_events(html_doc: bool = None)[source]
Parameters:html_doc – If True then the docstring will be parsed into HTML (default: False)
get_all_plugins(html_doc: bool = None)[source]
Parameters:html_doc – If True then the docstring will be parsed into HTML (default: False)
get_all_responses(html_doc: bool = None)[source]
Parameters:html_doc – If True then the docstring will be parsed into HTML (default: False)
get_procedures() → dict[source]

Get the list of procedures installed on the device.

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]
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)