root/trunk/extensions/EvalLibrary.py

Revision 109 (by mbutscher, 03/21/07 07:27:29)

trunk

* updated to 1.9beta2


branches/mbutscher/work

* updating gadfly to support db compatibility between Python

2.5 and 2.4

from time import strftime
import pwiki.urllib_red as urllib

def now():
    return strftime("%x %I:%M %p")

def addDateTime(editor):
    return editor.AddText(now())

def date():
    return strftime("%x")

def addDate(editor):
    return editor.AddText(date())

def time():
    return strftime("%I:%M %p")

def addTime(editor):
    return editor.AddText(time())

def encodeSelection(editor):
    text = editor.GetSelectedText()
    url = urllib.pathname2url(text)
    editor.ReplaceSelection("file:%s" % url)
Note: See TracBrowser for help on using the browser.