/crunchy/src/plugins/username.py
Python | 15 lines | 7 code | 0 blank | 8 comment | 0 complexity | 8e75e8afa89bb11dfc9a25b8db0c83ed MD5 | raw file
Possible License(s): BSD-3-Clause
- '''
- Username plugin.
- Enable the insertion of a user's username anywhere in a page.
- '''
- from src.interface import plugin, Element, SubElement
- def register():
- '''registers a simple tag handler'''
- plugin['register_tag_handler']("span", "title", "username", insert_username)
- def insert_username(page, elem, dummy):
- '''Inserts the username, replacing the text previously used as a placeholder.'''
- elem.text = page.username