Foundry.PtyDiagnostics

g Foundry.Contextual Foundry.Contextual Foundry.PtyDiagnostics Foundry.PtyDiagnostics Foundry.Contextual->Foundry.PtyDiagnostics GObject.GInterface GObject.GInterface Gio.ListModel Gio.ListModel GObject.GInterface->Gio.ListModel Json.Serializable Json.Serializable GObject.GInterface->Json.Serializable GObject.Object GObject.Object GObject.Object->Foundry.Contextual Gio.ListModel->Foundry.PtyDiagnostics Json.Serializable->Foundry.Contextual

Subclasses:

None

Methods

Inherited:

Foundry.Contextual (4), GObject.Object (37), Json.Serializable (8), Gio.ListModel (4)

Structs:

GObject.ObjectClass (5)

class

new (context, pty_fd)

class

register (regex)

create_producer ()

get_fd ()

reset ()

Virtual Methods

Inherited:

GObject.Object (7), Json.Serializable (5), Gio.ListModel (3)

Properties

Inherited:

Foundry.Contextual (1)

Signals

Inherited:

GObject.Object (1), Gio.ListModel (1)

Fields

Inherited:

GObject.Object (1), Gio.ListModel (1)

Class Details

class Foundry.PtyDiagnostics(**kwargs)
Bases:

Foundry.Contextual, Gio.ListModel

Abstract:

No

Structure:

Foundry.PtyDiagnosticsClass

Custom PTY intermediate that can extract diagnostics.

classmethod new(context, pty_fd)
Parameters:
  • context (Foundry.Context) – a [class`Foundry`.Context]

  • pty_fd (int) – a file-descriptor for PTY consumer

Return type:

Foundry.PtyDiagnostics

pty_fd should be a valid file-descriptor for the consumer side of the PTY device. This is sometimes, historically, called the “master” side of a PTY device.

pty_fd will be ``dup()``d.

You can use [method`Foundry`.PtyDiagnostics.get_fd] to get a new synthetic PTY consumer for which you can create a producer for and attach to child processes.

The resulting [class`Foundry`.PtyDiagnostics] is also a [iface`Gio`.ListModel] of [class`Foundry`.Diagnostic] so you may use the list model API to access diagnostics as they are discovered.

classmethod register(regex)
Parameters:

regex (GLib.Regex) –

Registers regex for use when extracting diagnostics from a PTY stream.

The regex should capture values into named groups that the [class`Foundry`.PtyDiagnostics] can turn into [class`Foundry`.Diagnostic].

Named groups supported are:

  • message

  • filename

  • line

  • column

  • level

create_producer()
Raises:

GLib.Error

Return type:

int

get_fd()
Return type:

int

reset()