Overview¶
Path | PyPoE/poe/text.py |
Version | 1.0.0a0 |
Revision | $Id: 703f14cb092b667c48f057c57bb2d1db129ba348 $ |
Author | Omega_K2 |
Description¶
Utilities for dealing with certain text/string related tasks in regards to PoE.
Agreement¶
See PyPoE/LICENSE
Documentation¶
-
class
PyPoE.poe.text.
Tag
(id=None, parent=None, children=None, parameter=None)[source]¶ Bases:
PyPoE.shared.mixins.ReprMixin
Represents a tag in PoE texts.
- For example:
<size:45>{I have <item>{My item} for sale}
tag.id = ‘size’ tag.parent = None tag.children = [‘I have ‘, <Tag object>, ‘ for sale’] tag.parameter = ‘45’
Parameters: Handle this and child tags with the handlers passed to this function.
Parameters: handlers (dict[str, callable]) – Dictionary containing a mapping of handler ids to callables that handle them.
- The callable will be passed two keyword parameters:
- hstr - the current contained string for the parameter to handle parameter - any parameters passed to the tag (may be None)
Returns: The handled string Return type: str Raises: KeyError
– if a id is not present in the handlers parameter