samlab.dashboard module¶
Warning
module ‘samlab.dashboard’ undocumented
- class samlab.dashboard.Server(host=None, port=None, config=True, coverage=False, quiet=True)[source]¶
Bases:
object
Create an instance of Dashboard for unit tests and tutorials. For your real work you will likely want to setup and administer a dedicated instance of the Samlab dashboard server; this class makes it easy to start a temporary instance for use in tutorials and our unit tests:
>>> server = samlab.dashboard.Server() ... Use the server here ... >>> server.stop() >>> database.stop()
Alternatively, you can use the server object as a context manager for automatic cleanup:
>>> with samlab.dashboard.Server() as server: ... ... Use the server here ... >>> # Server is automatically cleaned-up when the `with` block is exited.
- Parameters
- stop()[source]¶
Stop the running dashboard server. :raises RuntimeError, if called more than once, or called on an instance used as a context manager.:
- property uri¶
Address of the running server that can be used with web clients.