10.9 Probes 11 Complete List
API Reference Manual  /  10 Python API  / 

10.10 Other

Other Python-specific Classes and Functions

simics.CriticalErrors

NAME
CriticalErrors — represents critical errors caused by C code called from Python
SYNOPSIS
CriticalErrors(args)

DESCRIPTION
This exception is raised when returning to Python from a C function that directly or indirectly caused one or more serious, but recoverable, errors. Elaborate error descriptions are printed when the errors occur, but because of error recovery, the C function will be able to continue without being aware of the error.

A C function can cause more than one error; all these are combined into a single Python exception. The main purpose of the exception is to aid debugging, usually by providing a nice Python traceback.

table.column_names()

NAME
column_names — get hold of column names from a property list
SYNOPSIS
column_names(prop_list)

DESCRIPTION
Help function to retrieve the column names embedded in the list of table properties.
SEE ALSO
table.show

table.default_table_args()

NAME
default_table_args — get default table arguments
SYNOPSIS
default_table_args(set_dict={})

DESCRIPTION
Return the tuple representing the default table arguments. The set_dict can contain key/value elements overriding the default value. The key is the same as the name of the table argument in the command.
SEE ALSO
table.new_table_command, table.get

table.get()

NAME
get — fetch the formatted table
SYNOPSIS
get(properties, data, *table_args)

DESCRIPTION
Similar to the table.show but this function returns the table as a multi-line string.
SEE ALSO
table.new_table_command, table.get

table.get_table_arg_value()

NAME
get_table_arg_value — retrieve the value for a table command argument
SYNOPSIS
get_table_arg_value(arg, table_values)

DESCRIPTION
Allows the user command to look at a certain named parameter to get its value. For example, to internally make use of the -verbose flag. The arg argument specifies the argument to fetch the value of. The table_values argument is the tuple of table arguments received in the table.new_table_command() callback function.

table.new_table_command()

NAME
new_table_command — register a new command which prints a table
SYNOPSIS
new_table_command(command_name,
                  cmd_func,
                  args = None,
                  doc = "",
                  sortable_columns = None,
                  **kwargs)

DESCRIPTION
Register a specific command for printing the table, with all the command arguments from the <table>.print-table commands, but extendable with personalized argument handling. For example, a dedicated command could print out additional data, or filter out certain rows from the table and only print those.

All arguments here are similar to the cli.new_command() function except the sortable_columns argument.

The cmd_func function will be called with additional table argument last. The function should use the table.show() to produce the table output according to the user arguments.

If the sortable_columns argument is supplied, it should contain a list of the column namnes which can be used for sorting. This is only used for the expander function. If this argument is not set, the default expander will try to use the table interface to retrieve the column names.

SEE ALSO
cli.new_command, table.show

table.show()

NAME
show — format and print the table
SYNOPSIS
show(properties, data, *table_args)

DESCRIPTION
This function should be used from a command function registered through the table.new_table_command() function to print out the table according to the user arguments. The properties argument is a list of key/value pairs setting table properties for the table. The data argument contains the two-dimensional data to be printed where the inner list contains the columns and the outer list the rows of the table. See the table interface for more information.

The *table_args argument represents the standard table arguments, received last in the table.new_table_command() callback function.

SEE ALSO
table.new_table_command, table.get

10.9 Probes 11 Complete List