Module Assign NameStore Str Import alias Import alias ImportFrom alias If BoolOpAnd CompareNotIn Str AttributeLoad NameLoad attr CompareEq NameLoad Str body Import alias ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults kwarg body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore IfExp NameLoad Call NameLoad NameLoad Str Call NameLoad TryFinally body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot NameLoad body Return Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr attr Str Str attr Str finalbody Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Call NameLoad keyword NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore IfExp Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr If BoolOpAnd NameLoad UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad Call NameLoad keyword NameLoad attr keyword NameLoad TryExcept body Return Call AttributeLoad Call NameLoad keyword NameLoad attr handlers ExceptHandler type NameLoad body TryExcept body Return Call AttributeLoad Call NameLoad keyword NameLoad attr handlers ExceptHandler type NameLoad body Raise Call NameLoad BinOpMod Str NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Return CompareEq SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num Str decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword TupleLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad Str NameLoad Num body Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num orelse If NameLoad body For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr Str orelse Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults kwarg body If BoolOpAnd NameLoad NameLoad body Raise Call NameLoad Str If BoolOpAnd NameLoad BoolOpOr CompareGt Call NameLoad NameLoad Num UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Num body Raise Call NameLoad Str If BoolOpAnd UnaryOpNot BoolOpOr NameLoad NameLoad CompareGt Call NameLoad NameLoad Num body Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults kwarg body If UnaryOpNot NameLoad body If BoolOpOr NameLoad NameLoad CompareLt Call NameLoad NameLoad Num body Return NameLoad Assign NameStore SubscriptLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Num Index Num Slice Num Assign NameStore Call AttributeLoad NameLoad attr If CompareNotIn NameLoad ListLoad Str Str Str body Raise Call NameLoad BinOpMod Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore Call NameLoad NameLoad If CompareLt NameLoad Num body Raise NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad Call NameLoad attr NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Slice Num
N/A N/A USAGE robot.tidy -- Robot Framework test data clean-up tool.

Version:  <VERSION>

Usage:  python -m robot.tidy [options] inputfile
   or:  python -m robot.tidy [options] inputfile [outputfile]
   or:  python -m robot.tidy --inplace [options] inputfile [more input files]
   or:  python -m robot.tidy --recursive [options] directory

Tidy tool can be used to clean up and change format of Robot Framework test
data files. The output is written into the standard output stream by default,
but an optional output file can be given starting from Robot Framework 2.7.5.
Files can also be modified in-place using --inplace or --recursive options.

Options
=======

 -i --inplace    Tidy given file(s) so that original file(s) are overwritten
                 (or removed, if the format is changed). When this option is
                 used, it is possible to give multiple input files.
                 Examples:
                   python -m robot.tidy --inplace tests.html
                   python -m robot.tidy --inplace --format txt *.html
 -r --recursive  Process given directory recursively. Files in the directory
                 are processed in-place similarly as when --inplace option
                 is used.
 -f --format txt|html|tsv
                 Output file format. If omitted, the format of the input
                 file is used.
 -p --usepipes   Use pipe (`|`) as a cell separator in the txt format.
 -s --spacecount number
                 The number of spaces between cells in the txt format.
                 New in Robot Framework 2.7.3.
 -h -? --help    Show this help.

Cleaning up the test data
=========================

Test case files created with HTML editors or written by hand can be normalized
using tidy. Tidy always writes consistent headers, consistent order for
settings, and consistent amount of whitespace between cells and tables.

Examples:
  python -m robot.tidy messed_up_tests.html cleaned_tests.html
  python -m robot.tidy --inplace tests.txt

Changing the test data format
=============================

Robot Framework supports test data in HTML, TSV and TXT formats and this tool
makes changing between the formats trivial. Input format is always determined
based on the extension of the input file. Output format can be set using
the --format option.

Examples:
  python -m robot.tidy --format tsv --inplace tests.html
  python -m robot.tidy --format txt --recursive mytests

Output encoding
===============

All output files are written using UTF-8 encoding. Outputs written to the
console use the current console encoding.

Alternative execution
=====================

In the above examples tidy is used only with Python, but it works also with
Jython and IronPython. Above tidy is executed as an installed module, but
it can also be executed as a script like `python path/robot/tidy.py`.
 N/A os N/A sys StringIO StringIO N/A N/A N/A robot N/A sys modules N/A __name__ __main__ N/A N/A pythonpathsetter robot.errors DataError robot.parsing ResourceFile TestDataDirectory TestCaseFile disable_curdir_processing robot.utils Application Tidy N/A object N/A __init__ N/A N/A self N/A options N/A N/A N/A self _options options N/A file N/A N/A self path output N/A None N/A N/A data N/A N/A self _create_datafile path N/A outfile N/A output N/A open output w N/A StringIO N/A N/A N/A N/A N/A self _save_file data outfile N/A N/A output N/A N/A N/A N/A N/A N/A N/A N/A outfile getvalue replace decode UTF-8 N/A N/A N/A N/A outfile close N/A directory N/A N/A self path N/A N/A N/A N/A N/A self _save_directory N/A N/A N/A TestDataDirectory source path populate N/A inplace N/A N/A self path N/A N/A N/A N/A N/A self _save_file N/A N/A self _create_datafile path N/A _save_file N/A N/A self data output N/A None N/A N/A source N/A N/A N/A self _is_directory data N/A data initfile N/A data source N/A N/A source N/A output N/A N/A N/A N/A os remove source N/A N/A N/A data save output output N/A self _options N/A _save_directory N/A N/A self data N/A N/A N/A N/A N/A N/A self _is_directory data N/A N/A N/A N/A self _save_file data N/A N/A N/A data initfile N/A N/A N/A N/A self _save_file data N/A child N/A data children N/A N/A N/A N/A self _save_directory child N/A _is_directory N/A N/A self data N/A N/A N/A N/A hasattr data initfile N/A _create_datafile N/A N/A self source N/A N/A N/A N/A N/A self _is_init_file source N/A N/A dir_ N/A N/A N/A os path dirname source N/A N/A N/A N/A TestDataDirectory source dir_ populate recurse False N/A N/A N/A N/A N/A N/A TestCaseFile source source populate N/A N/A N/A DataError N/A N/A N/A N/A N/A N/A N/A ResourceFile source source populate N/A N/A N/A DataError N/A N/A N/A DataError N/A Invalid data source '%s'. source N/A disable_curdir_processing _is_init_file N/A N/A self source N/A N/A N/A N/A N/A N/A N/A N/A os path splitext N/A N/A N/A os path basename source N/A 0 __init__ N/A N/A TidyCommandLine N/A Application N/A __init__ N/A N/A self N/A N/A N/A N/A N/A Application __init__ self USAGE arg_limits N/A 1 N/A main N/A N/A self arguments recursive inplace format usepipes spacecount N/A False False txt False 4 N/A N/A tidy N/A Tidy format format pipe_separated usepipes txt_separating_spaces spacecount N/A recursive N/A N/A N/A N/A tidy directory N/A arguments N/A 0 N/A N/A inplace N/A N/A source arguments N/A N/A N/A N/A tidy inplace source N/A N/A output N/A N/A tidy file arguments N/A N/A N/A self console output N/A validate N/A N/A self opts args N/A N/A N/A N/A N/A self _validate_mode_and_arguments args opts N/A N/A opts N/A format N/A N/A self _validate_format args opts N/A N/A N/A opts N/A spacecount N/A N/A N/A N/A opts pop spacecount N/A N/A N/A opts N/A spacecount N/A N/A self _validate_spacecount N/A opts N/A spacecount N/A N/A opts args N/A _validate_mode_and_arguments N/A N/A self args inplace recursive N/A others N/A N/A N/A inplace recursive N/A N/A N/A DataError --recursive and --inplace can not be used together. N/A N/A recursive N/A N/A N/A len args 1 N/A N/A N/A N/A os path isdir N/A args N/A 0 N/A N/A N/A DataError --recursive requires exactly one directory as argument. N/A N/A N/A N/A inplace recursive N/A N/A len args 2 N/A N/A N/A DataError Default mode requires 1 or 2 arguments. N/A _validate_format N/A N/A self args format inplace recursive N/A others N/A N/A N/A format N/A N/A N/A inplace recursive N/A N/A len args 2 N/A N/A None N/A format N/A N/A N/A N/A N/A os path splitext N/A args N/A 1 N/A 1 N/A 1 N/A format N/A N/A format upper N/A N/A format N/A TXT TSV HTML N/A N/A N/A DataError N/A Invalid format: '%s'. format N/A format N/A _validate_spacecount N/A N/A self spacecount N/A N/A N/A N/A N/A spacecount N/A int spacecount N/A N/A spacecount 2 N/A N/A ValueError N/A N/A N/A ValueError N/A N/A N/A DataError --spacecount must be an integer greater than 1. N/A spacecount N/A N/A tidy_cli N/A N/A args N/A N/A N/A Executes tidy similarly as from the command line.

    :param args: command line arguments as a list of strings.

    Example:
        tidy_cli(['--format', 'txt', 'mytests.html'])
     N/A N/A N/A N/A TidyCommandLine execute_cli args N/A N/A N/A __name__ __main__ N/A N/A N/A tidy_cli N/A N/A sys argv N/A 1