Spacer
Spacer class for “text:s” tag.
Classes:
| Name | Description |
|---|---|
Spacer |
Representation of several spaces, “text:s”. |
Spacer
Bases: MDSpacer, Element
Representation of several spaces, “text:s”.
This element shall be used to represent the second and all following ” ” (U+0020, SPACE) characters in a sequence of ” ” (U+0020, SPACE) characters. It’s good practice to use this element only for the second and all following SPACE characters in a sequence, though it’s not an error if the preceding character is not a white space.
Methods:
| Name | Description |
|---|---|
__init__ |
Create a Spacer element, “text:s”, representing several spaces. |
__str__ |
|
Attributes:
| Name | Type | Description |
|---|---|---|
length |
int
|
Get the number of spaces represented by the spacer. |
number |
str | None
|
|
text |
str
|
Get the string representation of the spacer. |
Source code in odfdo/spacer.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
_properties
class-attribute
instance-attribute
_properties: tuple[PropDef | PropDefBool, ...] = (
PropDef("number", "text:c"),
)
_tag
class-attribute
instance-attribute
_tag = 'text:s'
length
property
writable
length: int
Get the number of spaces represented by the spacer.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The number of spaces. |
number
instance-attribute
number: str | None = str(number)
text
property
writable
text: str
Get the string representation of the spacer.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A string composed of spaces, e.g., ” “. |
__init__
__init__(number: int | None = 1, **kwargs: Any) -> None
Create a Spacer element, “text:s”, representing several spaces.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
number
|
int | None
|
The number of spaces. Defaults to 1. |
1
|
Source code in odfdo/spacer.py
47 48 49 50 51 52 53 54 55 56 57 58 | |
__str__
__str__() -> str
Source code in odfdo/spacer.py
60 61 | |