Extended Monitoring Guide

  • Docs Home
  • Community Home

8. Other Commands

  • tidy_ok - Check to see if the tidy command runs on this page without any errors or warnings.

  • exit *[<code>]* - Exit with the given integer code, if specified. The value of <code> defaults to 0.

  • run <command> - Execute the specified Python command.

  • runfile <file1> [ <file2> ... ]* - Execute the specified files.

  • agent - Set the browser's "User-agent" string.

  • sleep [<seconds>] - sleep the given number of seconds. Defaults to 1 second.

  • reset_browser - Reset the browser.

  • extend_with <module> - Import commands from the specified Python module. This acts like ``from <module> import *`` does in Python.

    For example, a function ``fn`` in ``extmodule`` would be available as ``fn``. See *examples/extend_example.py* for an example.

  • add_auth <realm> <uri> <user> <password> - Add HTTP Basic Authentication information for the given realm/URL combination.

    For example, “add_auth IdyllStuff http://www.idyll.org/ titus test” tells twill that a request from the authentication realm "IdyllStuff" under http://www.idyll.org/ should be answered with username 'titus', password 'test'. If the 'with_default_realm' option is set to True, ignore 'realm'.

  • config [<key> [<value>]] - Show/set configuration options.

  • add_extra_headers <name> <value> - Add an extra HTTP header to each HTTP request.

  • show_extra_headers - Show the headers being added to each HTTP request.

  • clear_extra_headers - Clear the headers being added to each HTTP request.