• Language: en

popy_run

The most important command in the suite of Command Line Tools is popy_run. It processes PoPy scripts.

Running a script

To run a PoPy script Open a PoPy Command Prompt and type:-

$ popy_run my_script.pyml

What happens with the script depends on its type. There are many script formats:-

See Script File Formats for more information.

Note a common switch to use with popy_run is:-

$ popy_run -o my_script.pyml

Here the ‘-o’ option overwrites previous output automatically. If the script has already been run and you do not use the ‘-o’ option, you will be asked to confirm you want to overwrite any previous output.

For other command line options see Command line options.

Running multiple scripts

Note you can also run all scripts in a directory using:-

$ popy_run *.pyml

This runs all files with the ‘.pyml’ extension in serial.

Log files created by popy_run

When popy_run processes a script file, it creates a log file:-

my_script.pyml.run.main.log

as a record of the output. If a runtime error occurs during processing, a stack trace is sent to:-

my_script.pyml.run.error.log

as a record of what went wrong.

Command line options

Note: "popy_run ..." will be deprecated in favour of "popy run ..." from v1.3

usage: popy_run [-h] [-t] [-a] [-c] [-l] [-s]
                [-v {noset,info,debug,warning,error,critical}] [-o]
                [--no_check] [-r] [-w N] [--log_folder LOG_FOLDER]
                script_path

Runs a PoPy script.

positional arguments:
  script_path           Required path to configuration file.

optional arguments:
  -h, --help            show this help message and exit
  -t, --timestamp       Optionally included timestamp string in log file name
                        and output folder name.
  -a, --all_config      Optionally output all possible config file entries in
                        output script files. If set to false, the default
                        entries with default values are suppressed for the
                        sake of brevity.
  -c, --comment_scripts
                        Optionally add explanatory comments to all entries in
                        output script files.
  -l, --line_breaks     Optionally enforce line breaks in the config file.
                        This increases the length of files, but may improve
                        clarity. If set to False, short dictionary lines are
                        compacted instead using {} notation.
  -s, --spaces          Optionally add more spaces to the output config file
                        for greater clarity, but longer config files. Off by
                        default.
  -v {noset,info,debug,warning,error,critical}, --verbosity {noset,info,debug,warning,error,critical}
                        verbosity of output in log file
  -o, --overwrite       Optionally overwrite existing output files without
                        asking.
  --no_check            Optionally do NOT run the PoPy script checking i.e
                        silence the warnings and errors output at the start
                        this option is not recommended, but you can use if you
                        do not believe the warnings/errors and want to run
                        your script regardless.
  -r, --replicate_scripts
                        Suppress replicating input config files in log files.
  -w N, --worker_index N
                        Optionally provide a worker index, so get separate log
                        files for each worker
  --log_folder LOG_FOLDER
                        Optional path to worker log folder.
Back to Top