main - noetl/noetl GitHub Wiki

Parameters

  • argv: command line arguments

Key Variables

  • configFileName: filename passed in as a command line argument
  • configFile: file object obtained using the configFileName
  • config: parsed configFile
  • exitCode: records the success of executing the task
  • testIt: if True, will run the workflow test functions

Functionality

  • The main function opens and loads the configuration file, specified by the configFileName, parses it, and stores it in the config variable.
  • If the testIt flag is marked, doTest is called on the WORKFLOW test functions.
  • Otherwise, the "start" task is instantiated, and getTask is called on task, with the return value stored in exitCode.

Except Statement

-The function falls into the except statements if there is an IndexError or a Usage error.

  • except IndexError: resets the configFileName to a default, hardcoded path, and prints the date and the default configFileName.
  • except Usage: the function prints out the traceback and exception, and the error message. Returns 2.

Return Value

None