Simple API - mushroom.simple¶
-
class
mushroom.simple.SimpleApplication(urls=None, rpc_handler=None, session_handler=None)¶ -
request(request)¶
-
-
class
mushroom.simple.SimpleServer(listener, **kwargs)¶ This is the preferred way of starting to work with mushroom. This server class makes it possible to use mushroom with only a few lines of code by relying on some defaults:
- All RPC methods are prefixed with
rpc_ - Session handlers calls are prefixed wit
session_ - The server runs on localhost with port
39288
In order to use this class create a subclass from it, overwrite the urls attribute and start YourServer.main().
-
host= '127.0.0.1'¶
-
classmethod
main()¶
-
port= 39288¶
-
server_init()¶
-
session_authenticate(session, auth)¶
-
session_connect(session)¶
-
session_disconnect(session)¶
-
urls= None¶
- All RPC methods are prefixed with
-
class
mushroom.simple.StaticFile(filename)¶ -
content_types= {'css': 'text/css', 'gif': 'image/gif', 'html': 'text/html', 'ico': 'image/x-icon', 'jpg': 'image/jpeg', 'js': 'text/javascript', 'json': 'application/json', 'png': 'image/png', 'txt': 'text/plain'}¶
-
get(request)¶
-
load_file()¶
-
-
mushroom.simple.parse_listener(value)¶