Meta Auto Reload
MetaAutoReload class for “meta:auto-reload” tag.
Classes:
| Name | Description |
|---|---|
MetaAutoReload |
Container for auto-reload properties, “meta:auto-reload”. |
MetaAutoReload
Bases: Element
Container for auto-reload properties, “meta:auto-reload”.
Methods:
| Name | Description |
|---|---|
__init__ |
Initialize a MetaAutoReload element. |
__repr__ |
|
__str__ |
|
as_dict |
Return the attributes of the auto-reload element as a Python dictionary. |
from_dict |
Set the attributes of the auto-reload element from a Python dictionary. |
Attributes:
| Name | Type | Description |
|---|---|---|
actuate |
|
|
href |
|
|
show |
|
|
type |
|
Source code in odfdo/meta_auto_reload.py
31 32 33 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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
_properties
class-attribute
instance-attribute
_properties: tuple[PropDef | PropDefBool, ...] = (
PropDef("delay", "meta:delay"),
PropDef("actuate", "xlink:actuate"),
PropDef("href", "xlink:href"),
PropDef("show", "xlink:show"),
PropDef("type", "xlink:type"),
)
_tag
class-attribute
instance-attribute
_tag = 'meta:auto-reload'
actuate
instance-attribute
actuate = 'onLoad'
href
instance-attribute
href = href
show
instance-attribute
show = 'replace'
type
instance-attribute
type = 'simple'
__init__
__init__(
delay: timedelta | None = None,
href: str = "",
**kwargs: Any,
) -> None
Initialize a MetaAutoReload element.
The meta:auto-reload element specifies whether a document is
reloaded or replaced by another document after a specified period
of time has elapsed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delay
|
timedelta | None
|
The time delay after which the document should auto-reload. |
None
|
href
|
str
|
The URL or path to the document to reload or replace with. |
''
|
**kwargs
|
Any
|
Additional keyword arguments for the parent |
{}
|
Source code in odfdo/meta_auto_reload.py
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 | |
__repr__
__repr__() -> str
Source code in odfdo/meta_auto_reload.py
70 71 72 73 74 75 76 77 | |
__str__
__str__() -> str
Source code in odfdo/meta_auto_reload.py
79 80 | |
_set_delay
_set_delay(delay: timedelta | None) -> None
Set the meta:delay attribute from a timedelta object.
Converts the timedelta to an ODF duration string. If delay is
None, it defaults to timedelta(0).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delay
|
timedelta | None
|
The delay duration. |
required |
Source code in odfdo/meta_auto_reload.py
82 83 84 85 86 87 88 89 90 91 92 93 | |
as_dict
as_dict() -> dict[str, Any]
Return the attributes of the auto-reload element as a Python dictionary.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
dict[str, Any]: A dictionary containing the meta auto-reload attributes, with keys like “meta:delay”, “xlink:href”, etc. |
Source code in odfdo/meta_auto_reload.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
from_dict
from_dict(data: dict[str, Any]) -> None
Set the attributes of the auto-reload element from a Python dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
A dictionary containing the meta auto-reload attributes (e.g., “meta:delay”, “xlink:href”). |
required |
Source code in odfdo/meta_auto_reload.py
117 118 119 120 121 122 123 124 125 126 127 128 | |