autodrive.formatting.format_rng

Module Contents

Classes

RangeCellFormatting

Contains request generation methods related to formatting a Range’s grid

RangeGridFormatting

Contains request generation methods relating to formatting a Range’s

RangeTextFormatting

Contains request generation methods methods relating to formatting this

class autodrive.formatting.format_rng.RangeCellFormatting(parent)

Contains request generation methods related to formatting a Range’s grid (width and height, etc).

Parameters

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

add_alternating_row_background(self, colors)

Queues a request to add an alternating row background of the indicated color to a Range’s cells.

Parameters

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

Returns

This formatting object, so further requests can be

queued if desired.

Return type

RangeCellFormatting

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_rng.RangeGridFormatting(parent)

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

Parameters

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

auto_column_width(self)

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

Returns

This formatting object, so further requests can be

queued if desired.

Return type

RangeGridFormatting

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_rng.RangeTextFormatting(parent)

Contains request generation methods methods relating to formatting this Range’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)

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.

Returns

This formatting object, so further requests can be

queued if desired.

Return type

RangeTextFormatting

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