Common UI interfaces and classes.



MultiFieldLine class, FieldStretchiness enum and DisplayField namedtuple.

class AutoArchive._infrastructure.ui.multi_field_line.MultiFieldLine(fields, referenceLineWidth=1000)[source]

Bases: object

A line of text that consists of multiple fields.

  • fields (Sequence<DisplayField>) – Parts that together assembles the line.
  • referenceLineWidth (int) – Total physical width of the line used as a reference for computing physical widths based on relative widths of fields and re-computing them to a different total size in computeFieldWidths().

Computes physical width for each field.

Widths are computed based on relative widths and stretchiness so that total line width is no bigger than passes physicalLineWidth.

Parameters:physicalLineWidth (int) – Actual total line width (in the same units as referenceLineWidth.
Returns:Sequence of physical widths in the same order as fields.
Return type:list<int>

Gets fields that this line consists of.

Return type:Sequence<DisplayField>
class AutoArchive._infrastructure.ui.multi_field_line.DisplayField(text, widthWeight, stretchiness)

Bases: tuple

One part of a multi-field line.

  • text (str) – Text that shall be displayed in the field.
  • widthWeight (float) – Number from 0 to 1 which represents relative width of the field. 0 means zero width and 1 means maximal width.
  • stretchiness (FieldStretchiness) – Determines how much the field change its size when the actual total line width changes.

Alias for field number 2


Alias for field number 0


Alias for field number 1

AutoArchive._infrastructure.ui.multi_field_line.FieldStretchiness = Normal, Medium, Low

Display field stretchiness.


UiMessageKinds and VerbosityLevels enums.

AutoArchive._infrastructure.ui.constants.UiMessageKinds = Verbose, Notification, Info, Warning, Error

Kinds of user messages.

AutoArchive._infrastructure.ui.constants.VerbosityLevels = Quiet, Normal, Verbose

Verbosity levels.