Utilities

Provides handy functions.

frame_str(frame: iterm2.util.Frame) → str

Formats a Frame as a human-readable string.

Return type

str

Parameters

frame (Frame) – The frame to convert.

Returns

A human-readable string.

size_str(size: iterm2.util.Size) → str

Formats a Size as a human-readable string.

Return type

str

Parameters

size (Size) – The size to convert.

Returns

A human-readable string.


class Size(width: int, height: int)

Describes a 2D size.

Can be used where api_pb2.Size is accepted.

property height

Gets the height

property json

Gives a JSON representation of the size.

property width

Gets the width


class Point(x: int, y: int)

Describes a 2D coordinate.

Can be used where api_pb2.Point is accepted.

property json

Returns a JSON representation of the point.

property x

Returns the x coordinate

property y

Returns the y coordinate


class Frame(origin: iterm2.util.Point = (0, 0), size: iterm2.util.Size = <iterm2.util.Size object>)

Describes a bounding rectangle. 0,0 is the bottom left coordinate.

property json

Returns a JSON representation of the frame.

property origin

The top-left coordinate.

Returns

A Point.

property size

The size.

Returns

A Size.


class CoordRange(start: iterm2.util.Point, end: iterm2.util.Point)

Describes a range of contiguous cells.

Parameters
  • start – The start point.

  • end – The first point after the start point not in the range.

property end
Returns

The first Point after self.start not in the range.

property start
Returns

The start Point.


class Range(location: int, length: int)

Describes a range of integers.

Parameters
  • location – The first value in the range.

  • length – The number of values in the range.

property length
Returns

The length of the range.

property location
Returns

The first location of the range.


class WindowedCoordRange(coordRange: iterm2.util.CoordRange, columnRange: Optional[iterm2.util.Range] = None)

Describes a range of coordinates, optionally constrained to a continugous range of columns.

Parameters
  • coordRange – The range of cells.

  • columnRange – The range of columns to intersect with coordRange to get the described region, or None if unwindowed.

property columnRange
Returns

The range of columns, or an empty range if unconstrained.

property coordRange
Returns

The range of coordinates.


Indices and tables