ramble.cmd.common package

ramble.cmd.common.shell_init_instructions(cmd, equivalent)[source]

Print out instructions for users to initialize shell support.

Parameters:
  • cmd (str) – the command the user tried to run that requires shell support in order to work

  • equivalent (str) – a command they can run instead, without enabling shell support

Submodules

ramble.cmd.common.arguments module

ramble.cmd.common.arguments.add_common_arguments(parser, list_of_arguments)[source]

Extend a parser with extra arguments

Parameters:
  • parser – parser to be extended

  • list_of_arguments – arguments to be added to the parser

ramble.cmd.common.arguments.allows_unknown_args(command)[source]

Implements really simple argument injection for unknown arguments.

Commands may add an optional argument called “unknown args” to indicate they can handle unknown args. This checks that the command allows unknown_args as an input argument.

ramble.cmd.common.arguments.validate_unknown_args(command, unknown_args)[source]

Validate command allows unknown arguments when they are passed in

ramble.cmd.common.info module

ramble.cmd.common.info.all_object_attributes(obj)[source]

Return a list of all attributes on the object

Determine which of the available attributes a given object has (and has definitions in) and return a list of such attributes.

Returns:

List of all attributes the object contains

Return type:

(list)

ramble.cmd.common.info.print_all_attributes(obj, verbose=False, pattern='*', format=supported_formats.text)[source]

Print every attribute on an object

Iterate over all attributes for a given object, and print each one individually.

ramble.cmd.common.info.print_attribute_header(attr, verbose=False)[source]

Print the attribute header

The attribute header is a separator between different attributes in the output.

ramble.cmd.common.info.print_info(args)[source]

Primary entrypoint for the info command

ramble.cmd.common.info.print_object_header(obj_type, obj)[source]

Print an object header

ramble.cmd.common.info.print_object_overview(obj)[source]

Print object overview

Print the available attributes within a given object.

ramble.cmd.common.info.print_single_attribute(obj, attr, verbose=False, pattern='*', format=supported_formats.text)[source]

Handle printing a single attribute

For a given object, print a single attribute of this based on the given format specification and filter pattern.

ramble.cmd.common.info.setup_info_parser(subparser)[source]

Create the info parser

class ramble.cmd.common.info.supported_formats(*values)

Bases: Enum

lists = 2
text = 1

ramble.cmd.common.list module

ramble.cmd.common.list.formatter(func)[source]

Decorator used to register formatters

ramble.cmd.common.list.html(obj_names, out, object_type)[source]

Print out information on all objects in Sphinx HTML.

This is intended to be inlined directly into Sphinx documentation. We write HTML instead of RST for speed; generating RST from all objects causes the Sphinx build to take forever. Including this as raw HTML is much faster.

ramble.cmd.common.list.name_only(objs, out, object_type)[source]
ramble.cmd.common.list.perform_list(args)[source]
ramble.cmd.common.list.rows_for_ncols(elts, ncols)[source]

Print out rows in a table with ncols of elts laid out vertically.

ramble.cmd.common.list.setup_list_parser(subparser)[source]
ramble.cmd.common.list.version_json(obj_names, out, object_type)[source]

Print all objects with their latest versions.