crunchy /crunchy/src/plugins/username.py

Language Python Lines 15
MD5 Hash 8e75e8afa89bb11dfc9a25b8db0c83ed
Repository http://crunchy.googlecode.com/svn/trunk/ View Raw File
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
'''
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
Back to Top