ViewerHandle¶
Qualified name: algan.viewer.viewer.ViewerHandle
- class ViewerHandle(server, session)[source]¶
Bases:
objectA running viewer, and the means to stop it.
Returned by
view(). Also a context manager, so a script can open a viewer for as long as it needs one and be sure the port is released.Methods
Serve on this thread until
stop()is called.Serve on a background thread and return immediately.
Stop serving and release the port.
One route's full URL, with this session's token attached.
Attributes
The viewer's own handle on the Scene, for tests and scripting.
The address the viewer is served at, session token included.
- property session: ViewerSession¶
The viewer’s own handle on the Scene, for tests and scripting.
- property url: str¶
The address the viewer is served at, session token included.
- url_for(path)[source]¶
One route’s full URL, with this session’s token attached.
Every route but the page itself needs the token, and
urlalready carries a query string, so a script or a test addressing the API asks for its URL here rather than concatenating onto that one.- Parameters:
path (str)
- Return type:
str