AutoArchive._infrastructure.ui
Common UI interfaces and classes.
Modules
multi_field_line
MultiFieldLine class, FieldStretchiness enum and DisplayField namedtuple.
-
class AutoArchive._infrastructure.ui.multi_field_line.MultiFieldLine(fields, referenceLineWidth=1000)[source]
Bases: builtins.object
A line of text that consists of multiple fields.
Parameters: |
- 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().
|
-
computeFieldWidths(physicalLineWidth)[source]
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> |
-
fields[source]
Gets fields that this line consists of.
Return type: | Sequence<DisplayField> |
-
class AutoArchive._infrastructure.ui.multi_field_line.DisplayField
Bases: builtins.tuple
One part of a multi-field line.
Parameters: |
- 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.
|
-
stretchiness
Alias for field number 2
-
text
Alias for field number 0
-
widthWeight
Alias for field number 1
-
AutoArchive._infrastructure.ui.multi_field_line.FieldStretchiness = Normal, Medium, Low
Display field stretchiness.
constants
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.