/crunchy/src/plugins/username.py
http://crunchy.googlecode.com/ · Python · 15 lines · 7 code · 0 blank · 8 comment · 0 complexity · 8e75e8afa89bb11dfc9a25b8db0c83ed MD5 · raw file
- '''
- 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