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: int

Gets the height

property json: str

Gives a JSON representation of the size.

property width: int

Gets the width


class Point(x: int, y: int)

Describes a 2D coordinate.

Can be used where api_pb2.Point is accepted.

property json: str

Returns a JSON representation of the point.

property x: int

Returns the x coordinate

property y: int

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: str

Returns a JSON representation of the frame.

property origin: iterm2.util.Point

The top-left coordinate.

Returns

A Point.

property size: iterm2.util.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: iterm2.util.Point
Returns

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

property start: iterm2.util.Point
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: int
Returns

The length of the range.

property location: int
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: iterm2.util.Range
Returns

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

property coordRange: iterm2.util.CoordRange
Returns

The range of coordinates.


Indices and tables