Manager

class falconry.manager(mgrDir: str, mgrMsg: str = '', maxJobIdle: int = -1)

Manager holds all jobs and periodically checks their status.

It also take care of dependent jobs, submitting jobs when all dependencies are satisfied. These are handled as decorations of the job.

Parameters:
  • mgrDir (str) – directory where the manager stores the jobs

  • mgrMsg (str) – message to be saved in the save file

  • maxJobIdle (int) – maximum number of idle jobs

add_job(j: job, update: bool = False)

Adds a job to the manager. If the job already exists and update is True, it will be updated.

Parameters:
  • j (job) – job to be added

  • update (bool, optional) – whether to update the job if it already

  • False. (exists. Defaults to)

ask_for_message()

Asks user for a message to be saved in the save file for bookkeeping.

check_savefile_status() Tuple[bool, str | None]

Checks if the save file already exists. If it does, asks the user whether to load existing jobs or start new ones.

Returns:

(True, ‘l’) if load, (True, ‘n’) if new, (False, None) if error

Return type:

Tuple[bool, Optional[str]]

load(retryFailed: bool = False)

Loads the saved status of the jobs from a json file provided by the user.

Parameters:
  • retryFailed (bool, optional) – whether to retry the failed jobs.

  • False. (Defaults to)

print_failed(printLogs: bool = False)

Prints names of all failed jobs.

Parameters:

printLogs (bool, optional) – whether to print paths to logs. Defaults to False.

save(quiet: bool = False)

Saves the current status of the jobs to a json file.

If quiet is True, it will not print any messages and will not make a time-stamped copy of the save file.

Parameters:

quiet (bool, optional) – whether to print messages. Defaults to False.

start(sleepTime: int = 60, gui: bool = False)

Starts the manager, iteratively checking status of jobs.

Makes sure to save the current state of jobs in case of interupt or crash.

Parameters:
  • sleepTime (int, optional) – time to sleep between checks. Defaults to 60.

  • gui (bool, optional) – whether to use GUI. Defaults to False. GUI is experimental!

start_safe(sleepTime: int = 60, gui: bool = False)

Deprecated! Use start instead!