lightlab.util.io.progress module¶
Some utility functions for printing to stdout used in the project
Also contains web-based progress monitoring
Summary¶
Classes:
ProgressWriter |
Writes progress to an html file for long sweeps. |
Functions:
printProgress |
Deletes current line and writes. |
printWait |
Prints your message followed by ... |
ptag |
Reference¶
-
printWait(*args)[source]¶ Prints your message followed by
...- This displays immediately, but
- your next print will show up on the same line
Parameters: *args (Tuple(str)) – Strings that will be written
-
printProgress(*args)[source]¶ Deletes current line and writes.
This is used for updating iterating values so to not produce a ton of output
Parameters: *args (str, Tuple(str)) – Arguments that will be written
-
class
ProgressWriter(name, swpSize, runServer=True, stdoutPrint=False, **kwargs)[source]¶ Bases:
objectWrites progress to an html file for long sweeps. Including timestamps. Has an init and an update method
You can then open this file to the internet by running a HTTP server.
To setup a continuously running server:
screen -S sweepProgressServer (Enter) cd /home/atait/Documents/calibration-instrumentation/sweepMonitorServer/ python3 -m http.server 8050 (Ctrl-a, d)
- To then access from a web browser::
- http://lightwave-lab-olympias.princeton.edu:8050
Todo
Have this class launch its own process server upon init Make it so you can specify actuator names
Parameters: -
progFileDefault= PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/lightlab/checkouts/development/progress-monitor/sweep.html')¶
-
tFmt= '%a, %d %b %Y %H:%M:%S'¶