class autopilot.display.Display

The base class/inteface for the display devices.

static create(preferred_backend='')

Get an instance of the Display class.

For more infomration on picking specific backends, see Advanced Backend Picking


A string containing a hint as to which backend you would like.

possible backends are:

  • X11 - Get display information from X11.
  • UPA - Get display information from the ubuntu platform API.
Raises:RuntimeError if autopilot cannot instantate any of the possible backends.
Raises:RuntimeError if the preferred_backend is specified and is not one of the possible backends for this device class.
Raises:BackendException if the preferred_backend is set, but that backend could not be instantiated.
Returns:Instance of Display with appropriate backend.
exception BlacklistedDriverError

Cannot set primary monitor when running drivers listed in the driver blacklist.


Get the number of screens attached to the PC.


Get the geometry for a particular monitor.

Returns:Tuple containing (x, y, width, height).

Return a BytesIO object of the png data for the screenshot image.

display_type is the display server type. supported values are:
  • “X11”
  • “MIR”
  • RuntimeError – If attempting to capture an image on an unsupported display server.
  • RuntimeError – If saving image data to file-object fails.