autodrive.formatting.format_tab

Module Contents

Classes

TabCellFormatting

Contains request generation methods relating to formatting this Tab’s cells

TabGridFormatting

Contains request generation methods related to formatting this Tab’s grid

TabTextFormatting

Contains request generation methods relating to formatting this Tab’s text

class autodrive.formatting.format_tab.TabCellFormatting(parent)

Contains request generation methods relating to formatting this Tab’s cells (like adding borders and backgrounds and such).

Parameters

parent (Component[Any, Any, Any]) – A Component object.

add_alternating_row_background(self, colors, rng=None)

Queues a request to add an alternating row background of the indicated color to this Tab’s cells, or to a range within the Tab.

Parameters
  • colors (Color) – The desired Color to apply to every other row.

  • rng (FullRange, optional) – A FullRange within the tab to apply the alternating row colors to.

Returns

This formatting object, so further requests can be

queued if desired.

Return type

TabCellFormatting

add_request(self, request)

Adds the passed request to the Formatting object’s parent component.

Parameters

request (Dict[str, Any]) – An api-ready request.

Return type

None

ensure_full_range(self, rng=None)

Convenience method for ensuring that all requests generated by this Formatting object have a FullRange attached to them, if one isn’t manually supplied.

Parameters

rng (FullRange, optional) – A manually generated FullRange, defaults to None.

Returns

The passed FullRange, or a range generated from the Formatting object’s parent Component.

Return type

FullRange

class autodrive.formatting.format_tab.TabGridFormatting(parent)

Contains request generation methods related to formatting this Tab’s grid (number of columns, rows, width and height, etc).

Parameters

parent (Component[Any, Any, Any]) – A Component object.

auto_column_width(self, rng=None)

Queues a request to set the column width of the Tab’s columns equal to the width of the values in the cells.

Parameters

rng (HalfRange, optional) – The range of columns to be affected, defaults to None for all columns in the Tab.

Returns

This formatting object, so further requests can be

queued if desired.

Return type

TabGridFormatting

append_rows(self, num_rows)

Queues a request to add new empty rows at the bottom of the Tab.

Parameters

num_rows (int) – The number of rows to add to the bottom of the Tab.

Returns

This formatting object, so further requests can be

queued if desired.

Return type

TabGridFormatting

insert_rows(self, num_rows, at_row)

Queues a request to insert new empty rows at the specified row number.

Parameters
  • num_rows (int) – The number of rows to insert.

  • at_row (int) – The row number to insert after.

Returns

This formatting object, so further requests can be

queued if desired.

Return type

TabGridFormatting

delete_rows(self, rng)

Queues a request to delete rows in the selected row range.

Parameters

rng (HalfRange) – The range of rows to delete.

Returns

This formatting object, so further requests can be

queued if desired.

Return type

TabGridFormatting

add_request(self, request)

Adds the passed request to the Formatting object’s parent component.

Parameters

request (Dict[str, Any]) – An api-ready request.

Return type

None

ensure_full_range(self, rng=None)

Convenience method for ensuring that all requests generated by this Formatting object have a FullRange attached to them, if one isn’t manually supplied.

Parameters

rng (FullRange, optional) – A manually generated FullRange, defaults to None.

Returns

The passed FullRange, or a range generated from the Formatting object’s parent Component.

Return type

FullRange

class autodrive.formatting.format_tab.TabTextFormatting(parent)

Contains request generation methods relating to formatting this Tab’s text (the text format of any cells, even those containing non-text values like integers or null values).

Parameters

parent (Component[Any, Any, Any]) – A Component object.

apply_format(self, format, rng=None)

Queues a request to set the text/number format of the Range’s cells.

Parameters
  • format (Format) – A format instance, such as TextFormat or NumberFormat.

  • rng (FullRange, optional) – Optional rnage within the Tab to apply the format to, defaults to None, for all cells in the Tab.

Returns

This formatting object, so further requests can be

queued if desired.

Return type

TabTextFormatting

add_request(self, request)

Adds the passed request to the Formatting object’s parent component.

Parameters

request (Dict[str, Any]) – An api-ready request.

Return type

None

ensure_full_range(self, rng=None)

Convenience method for ensuring that all requests generated by this Formatting object have a FullRange attached to them, if one isn’t manually supplied.

Parameters

rng (FullRange, optional) – A manually generated FullRange, defaults to None.

Returns

The passed FullRange, or a range generated from the Formatting object’s parent Component.

Return type

FullRange