malcolm.modules.web.parts

class malcolm.modules.web.parts.GuiServerPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller') = 'gui', path: Anno(name='APath', typ=<class 'str'>, description='Path to www directory to get files from') = '/home/docs/checkouts/readthedocs.org/user_builds/pymalcolm/checkouts/stable/malcolm/modules/web/www')[source]

Static file server to be used as a fallback. Must be last part

Parameters:
  • name (str) – The name of the Part within the Controller
  • path (str) – Path to www directory to get files from
GuiHandler = <MagicMock spec='str' id='139916657064976'>
setup(registrar: malcolm.core.part.PartRegistrar) → None[source]

Use the given PartRegistrar to populate the hooks and fields. This function is called for all parts in a block when the block’s Controller is added to a Process

on_report_handlers() → Union[Anno(name='AHandlerInfos', typ=<class 'malcolm.modules.web.infos.HandlerInfo'>, description='Any handlers and regexps that should form part of tornado App'), Sequence[malcolm.modules.web.infos.HandlerInfo], malcolm.modules.web.infos.HandlerInfo, None][source]
Returns:Any handlers and regexps that should form part of tornado App
Return type:HandlerInfo
class malcolm.modules.web.parts.RestfulServerPart(name: Anno(name='AName', typ=<class 'str'>, description='Part name and subdomain name to respond to queries on') = 'rest')[source]
Parameters:name (str) – Part name and subdomain name to respond to queries on
setup(registrar: malcolm.core.part.PartRegistrar) → None[source]

Use the given PartRegistrar to populate the hooks and fields. This function is called for all parts in a block when the block’s Controller is added to a Process

on_report_handlers() → Union[Anno(name='AHandlerInfos', typ=<class 'malcolm.modules.web.infos.HandlerInfo'>, description='Any handlers and regexps that should form part of tornado App'), Sequence[malcolm.modules.web.infos.HandlerInfo], malcolm.modules.web.infos.HandlerInfo, None][source]
Returns:Any handlers and regexps that should form part of tornado App
Return type:HandlerInfo
class malcolm.modules.web.parts.WebsocketServerPart(name: Anno(name='AName', typ=<class 'str'>, description='Part name and subdomain name to host websocket on') = 'ws', subnet_validation: Anno(name='ASubnetValidation', typ=<class 'bool'>, description='If True, check any client is in the same subnet as the host') = True)[source]
Parameters:
  • name (str) – Part name and subdomain name to host websocket on
  • subnet_validation (bool) – If True, check any client is in the same subnet as the host
setup(registrar: malcolm.core.part.PartRegistrar) → None[source]

Use the given PartRegistrar to populate the hooks and fields. This function is called for all parts in a block when the block’s Controller is added to a Process

on_report_handlers() → Union[Anno(name='AHandlerInfos', typ=<class 'malcolm.modules.web.infos.HandlerInfo'>, description='Any handlers and regexps that should form part of tornado App'), Sequence[malcolm.modules.web.infos.HandlerInfo], malcolm.modules.web.infos.HandlerInfo, None][source]
Returns:Any handlers and regexps that should form part of tornado App
Return type:HandlerInfo