Basic set of interface specifications.
Bases: pluggdapps.plugin.Interface
Interface specification to persist / access platform configuration to backend data-store or database. When platform gets booted and if config-backend is available, then configuration settings from datastore will override settings from .ini files.
If datastore does not exist, create one. Also intialize configuration tables for each mounted application under [mountloc] section. Expect this method to be called when ever platform starts-up. For more information refer to corresponding plugin’s documentation.
Bases: pluggdapps.plugin.Interface
Handle sub-commands issued from command line script. Plugins are expected to parse the command line string arguments into options and arguments and execute the sub-command.
A short description about plugin implementing this specification.
String describing the program usage
Name of sub-command
Use subparsers to create a sub-command parser. The subparsers object would have been created, by the main script, using ArgumentParser object parser.
Previously subparser() would have used set_default() method on subparser to set the handler attribute to this method so that this handler will automatically be invoked if the sub-command is used on the command line.
Bases: pluggdapps.plugin.Interface
Web server specification to bind and listen for new client connections. Every successfull connection will further be handled by IHTTPConnection plugin.
Mapping of socket (file-descriptor) listening for new connection and the socket object. These are server sockets.
List of accepted and active connections. Each connection is a plugin implementing IHTTPConnection interface.
HTTP Version supported by this server.
Stop listening for new connections. Close connections that are currently active and finally close the server sockets. Implementers must make sure that when this method is called start() method must return from blocking.
Close a client connection httpconn a IHTTPConnection plugin maintained in connections list.
Bases: pluggdapps.plugin.Interface
Every new client connection accepted by IHTTPServer will be handled by a plugin instance implementing this interface. All read-writes on the connection is specified by this interface.
Socket connection object accepted by the server.
Client’s IP address and port number.
IHTTPServer plugin that accepted this connection.
HTTP product string (byte-string) for this server. Typically sent with HTTP Server Reponse header.
HTTP Version supported by this connection. Normally infered from IHTTPServer.version attribute.
IHTTPRequest plugin instance for current on-going request.
Subscribe a callback function, to be called when the connection gets closed.
Subscribe a callback function, to be called when an on-going request/response is finished.
When a new request is received, this method is called to handle the request.
The request is resolved for configured web-application and dispatched to it.
For every request chunk received, this method will be called. For the last chunk trailers, if present, will also be passed. In case of chunked request, request attribute of this plugin will preserve the on-going request as IHTTPRequest plugin.
Write a chunk of data (bytes) to the connection and optionally subscribe a callback function to be called when data is successfully transfered.
Bases: pluggdapps.plugin.Interface
In pluggdapps, a web-Application is a plugin implementing this interface. And for this interface to be relevant, pluggdapps.platform.Webapps must be used to boot the platform. There is also a base class pluggdapps.web.WebApp which implements this interface and provides necessary support functions for application creators. Therefore application plugins must derive from this base class.
A tuple of (appsec, netpath, configini)
Optional read only copy of application’s settings. Gathered from plugin’s default settings, ini configuration file(s) and optionally a backend store.
Net location and script-path on which the instance of webapp is mounted. This is obtained from configuration settings.
Computed string of base url for web application, more-or-less similar to netpath.
Plugin instance implementing IHTTPRouter interface. This is the primary router using which request urls will be resolved to a view callable. Must be instantiated during boot time inside startapp() method.
Plugin instance implementing IHTTPCookie interface spec. Methods ” from this plugin will be used to process both request cookies and response cookies.
Plugin to handle web based interactive debugging. Used only when debug is enabled in configuration settings.
List of plugins implmenting pluggdapps.web.IHTTPInBound interface. In bound requests will be passed through plugins listed here before being dispatched to the router.
List of plugins implmenting pluggdapps.web.IHTTPOutBound interface. Out bound responses will be passed through plugins listed here before writing it on the connection.
This method is called after a new request is resolved to an application, typically by pluggdapps.web.IHTTPConnection plugin. This callback will be issued when,
It is responsibility of this method to initialize request plugin. Callback pluggdapps.web.interfaces.IHTTPRequest.handle() method. And finally use the pluggdapps.web.interfaces.IHTTPRouter.route() method to handle request.
This method is called for a request of type chunked encoding. Even in this case, a call to dorequest() is already made when the request was new. The request plugin is preserved after dorequest and a call back is made to this method for every new chunk that is received.
The callback will be issued when,
When finish is called on the request.response, by calling flush( finished=True ), a chain of onfinish() callbacks will be issued by pluggdapps.web.interfaces.IHTTPResponse.
Shutdown this application. Reverse of startapp().
Generate url (full url) for request using args and kwargs. Typically, pathfor() method shall be used to generate the relative url and joined with web-application’s webapp.base_url. To know more about method arguments refer corresponding router’s urlpath() interface method. Returns an absolute-URL as string.
Generate relative url for request using route definitions, args and kwargs. To learn more about args and kwargs, refer corresponding router’s pathfor() interface method. Returns a URL path as string.
Bases: pluggdapps.plugin.Interface
Interface specification for automatically creating scaffolds of source code and project tree based on collection of user-fed variables and a source-template.
One line description of scaffolding logic.
Bases: pluggdapps.plugin.Interface
Attributes and methods to render a page using supplied context.
Implementing plugin should interpret args and kwargs arguments and invoke one or more rendering resource (like templates). Typical plugins should accept key-word arguments like file and text, where file shall to template file or text shall point to template text - as string.
Returns html text as string.