The progress module

A tool for processing information about an experiment’s status.

Classes

StatusMonitor

class src.core.progress.StatusMonitor(name, timestampUpdate=False, timestampPost=True)[source]

A class for monitoring and displaying information to the user.

Many actions performed by instruments can take a significant amount of execution time, and the user will typically want some information about what is happening at a given moment.

This class allows information to be passed from the instruments (and the experiment or actions) and processed via Command objects, allowing the information to be redirected according to the program in question.

Methods

clear()[source]

Clear the status monitor’s information.

getName()[source]

Return the name of the status monitor.

Returns :

str :

The name of the status monitor.

post(message=None)[source]

Update the list of messages detailing the experiment’s past actions.

Parameters :

message : str

A string which should be tacked onto the list of past actions. If None, the last update will be sent to the past message list. Regardless, the current status message will be cleared.

setCommands(updateCommands=None, postCommands=None)[source]

Set the commands which will be executed upon updates.

Parameters :

updateCommands : list of Command

A list of Command objects to be executed when the update method is executed. currentMessage, a string, will be passed as a keyword argument to each Command.

postCommands : list of Command

A list of Command objects to be executed when the post method is executed. postedMessage, a string indicating the last completed action, will be passed as a keyword argument to each Command.

setName(name)[source]

Set the name of the status monitor.

Parameters :

name : str

The new name for the status monitor.

update(message)[source]

Update the message indicating the experiment’s current state.

Parameters :

message : str

A string indicating the experiment’s current status.

TextPrompter

class src.core.progress.TextPrompter(width=70)[source]

An object for prompting for user input from the command line.

Methods

prompt(prompt, options)[source]

Prompt the user for input.

Functions

src.core.progress.getStatusMonitor(name)[source]

Return a status monitor, creating it if it does not exist.

Parameters :

name : str

The name of the status monitor to get.

Returns :

StatusMonitor :

The StatusMonitor object with the specified name.

Table Of Contents

Previous topic

The errors module

Next topic

The configuration module

This Page