euporie.core.border
Define border styles.
Functions
|
Typed version of namedtuple. |
|
Return the character represented by a combination of |
|
Least-recently-used cache decorator. |
|
Class decorator that fills in missing ordering methods |
Classes
|
A description of a cell border: a |
|
Flag which indicate the connection of a grid node. |
|
Create a collection of name/value pairs. |
|
Fast, lightweight cache which keeps at most size items. |
|
Repreentation of a grid node character. |
|
Define the component characters of a grid. |
|
A collection of characters which can be used to draw a grid. |
|
Define a line style which can be used to draw grids. |
|
A mask which allows selection of a subset of a grid. |
|
A collection of default masks. |
- class euporie.core.border.DiLineStyle(top: LineStyle = LineStyle(None), right: LineStyle = LineStyle(None), bottom: LineStyle = LineStyle(None), left: LineStyle = LineStyle(None))
Bases:
NamedTuple
A description of a cell border: a
LineStyle
for each edge.- count(value, /)
Return number of occurrences of value.
- classmethod from_value(value: LineStyle) DiLineStyle
Construct an instance from a single value.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- class euporie.core.border.DirectionFlags(north: bool = False, east: bool = False, south: bool = False, west: bool = False)
Bases:
NamedTuple
Flag which indicate the connection of a grid node.
- count(value, /)
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- class euporie.core.border.GridChar(north: LineStyle, east: LineStyle, south: LineStyle, west: LineStyle)
Bases:
NamedTuple
Repreentation of a grid node character.
The four compass points represent the line style joining from the given direction.
- count(value, /)
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
- class euporie.core.border.GridPart(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
Define the component characters of a grid.
Character naming works as follows:
╭┈┈┈┈┈┈┈┈LEFT ┊ ╭┈┈┈┈┈┈MID ┊ ┊ ╭┈┈┈┈SPLIT ┊ ┊ ┊ ╭┈┈RIGHT ∨ ∨ ∨ v
TOP┈> ┏ ━ ┳ ┓ MID┈> ┃ ┃ ┃
SPLIT┈> ┣ ━ ╋ ┫
BOTTOM┈> ┗ ━ ┻ ┛
- BOTTOM_LEFT = 12
- BOTTOM_MID = 13
- BOTTOM_RIGHT = 15
- BOTTOM_SPLIT = 14
- MID_LEFT = 4
- MID_MID = 5
- MID_RIGHT = 7
- MID_SPLIT = 6
- SPLIT_LEFT = 8
- SPLIT_MID = 9
- SPLIT_RIGHT = 11
- SPLIT_SPLIT = 10
- TOP_LEFT = 0
- TOP_MID = 1
- TOP_RIGHT = 3
- TOP_SPLIT = 2
- class euporie.core.border.GridStyle(line_style: ~euporie.core.border.LineStyle = LineStyle(None), mask: ~euporie.core.border.Mask = <euporie.core.border.Mask object>)
Bases:
object
A collection of characters which can be used to draw a grid.
- property BOTTOM: _BorderLineChars
Allow dotted attribute access to the bottom grid row.
- property MID: _BorderLineChars
Allow dotted attribute access to the mid grid row.
- property SPLIT: _BorderLineChars
Allow dotted attribute access to the split grid row.
- property TOP: _BorderLineChars
Allow dotted attribute access to the top grid row.
- class euporie.core.border.LineStyle(name: str, rank: tuple[int, int], parent: euporie.core.border.LineStyle | None = None, visible: bool = True)
Bases:
object
Define a line style which can be used to draw grids.
GridStyle`s can be created from a :class:`LineStyle
by accessing an attribute with the name of a default mask fromMasks
.
- class euporie.core.border.Mask(mask: dict[euporie.core.border.GridPart, euporie.core.border.DirectionFlags])
Bases:
object
A mask which allows selection of a subset of a grid.
Masks can be combined to construct more complex masks.
- class euporie.core.border.Masks
Bases:
object
A collection of default masks.
- bottom_edge = <euporie.core.border.Mask object>
- center_edge = <euporie.core.border.Mask object>
- corners = <euporie.core.border.Mask object>
- grid = <euporie.core.border.Mask object>
- inner = <euporie.core.border.Mask object>
- left_edge = <euporie.core.border.Mask object>
- middle_edge = <euporie.core.border.Mask object>
- outer = <euporie.core.border.Mask object>
- right_edge = <euporie.core.border.Mask object>
- top_edge = <euporie.core.border.Mask object>