wiki:AutoEval

This plugin automatically evals wikipages when opened. To allow a wikipage to be automatically loaded you should set the property autoeval to "true" or "1"

"""AutoEval.py
	Automatically evals the page when opened if marked with autoeval property. 
	v0.1 by chaosct, 28 Apr 2009
"""

WIKIDPAD_PLUGIN = (("hooks", 1),)

def openedWikiWord(docPagePresenter, wikiWord):
	editor = docPagePresenter.getActiveEditor()
	properties = docPagePresenter.getWikiDocument().getWikiData().getPropertiesForWord(wikiWord)
	for (p,v) in properties:
		if p.upper() == 'AUTOEVAL' and (v.upper() == 'TRUE' or v == '1'):
			editor.evalScriptBlocks()

Last modified 8 years ago Last modified on May 9, 2009 10:11:58 AM