You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Christian Ziemski edited this page Mar 7, 2016
·
4 revisions
"""
SimpleStatusBar
Usage from WikidPad:
To create the status bar add a [:status:current_status] in the page content where the marker is desired.
current_status must be an integer between 0 and 6.
Licence: cc0
"""
WIKIDPAD_PLUGIN = (('InsertionByKey', 1),)
COLORLIST = ['#FFFFFF','#FF0000','#FF5500','#FFAA00','#FFFF00','#88FF00','#00FF00']
BASESTRING = "="
STARTSTRING = "{"
ENDSTRING = "}"
def describeInsertionKeys(ver, app):
return ((u'status', ('wikidpad_language',), StatusHandler),)
class StatusHandler(object):
def __init__(self, app):
self.app = app
def taskStart(self, exporter, exportType):
pass
def taskEnd(self):
pass
def getExtraFeatures(self):
return ()
def createContent(self, exporter, exportType, insToken):
status = int(insToken.getString()[9:-1])
if status > 6:
status = 6
text = BASESTRING*status + " "*(6-status)
return '''<small><code>%s<b><font color=%s>%s</font></b>%s</code></small>'''%(STARTSTRING,COLORLIST[status],text,ENDSTRING)