API References¶
Tools¶
- class pyrmin.tools(config=None)¶
PyRmin Tool Utility
import pyrmin pyrmin.tools(self.config)
Return the child menu of plugin_name
- bytes2human(n)¶
Take bytes and return a human readable string
- check_kwargs(args_array)¶
Return True if all paramaters exists
- get_kwargs(arg)¶
Return Request Parameter for POST and GET method
- get_plugin_config(plugin_name=None)¶
Return Plugin Namespace Configuration
- get_session(key)¶
Return Session Value from Plugin NameSpace
- init_html(template_name)¶
Get Template from plugin directory
- save_and_release_session()¶
- Workaround to cleanly release FileSessions in Cherrypy >= 3.3
From https://github.com/devsnd/cherrymusic/issues/483:
> CherryPy >=3.3.0 (up to current version, 3.6) makes it impossible to > explicitly release FileSession locks, because:
> 1. FileSession.save() asserts that the session is locked; and
> 2. _cptools.SessionTool always adds a hook to call sessions.save > before the response is finalized.
> If we still want to release the session in a controller, I guess the > best way to work around this is to remove the hook before the > controller returns:
- set_params(key, value)¶
Set Request Parameter for Distpatch method
- set_session(key, value)¶
Set Session Value in Plugin NameSpace
- to_json(dict, origin='*', auth=False)¶
Return dist as JSON with Access-Control-Allow-Origin Header
- tojson(dict, origin='*', auth=False)¶
Return dist as JSON with Access-Control-Allow-Origin Header