From abdb83efa4aac24e20207b36bf94a8491a43723d Mon Sep 17 00:00:00 2001 From: Gra Date: Fri, 12 Jun 2009 17:05:49 +0200 Subject: [PATCH] Added the (just downloaded) plugin file. --- ikogPlugin.py | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 ikogPlugin.py diff --git a/ikogPlugin.py b/ikogPlugin.py new file mode 100644 index 0000000..6304aac --- /dev/null +++ b/ikogPlugin.py @@ -0,0 +1,97 @@ +#### The ikogPlugin provides a mechanism for modifying the behaviour of +### iKog. Modify this file for your own purposes. +### The file merely needs to be saved in the same location as iKog.py. +### +### It can be quite tricky to see where the functions are called but the +### default implementation adds tags, which although disrupting the output, +### make it relatively easy to see where the methods are called. +### +### To make any practical use off the methods you will need to get out +### your regular expressions books and parse the strings - sorry :) +### Steve + + +### The string that is used as a divider on the console. +### In the standard application this is ~~~~~~~~~....~~~ +### @return the string you want to use as the divider +def getDivider(): + return "---my divider here---" + +### The string that is used as a ruler on the console. +### In the standard application this is _________....___ +### @return the string you want to use as the divider +def getRuler(): + return "---my ruler here---" + + +### Called after a valid string is entered from the keyboad. +### The function must return the string modified accordingly. +### This function must be modified with care as it can disrupt the operation +### of iKog commands. This default implementation merely replaces +### SB with Steve Butler. +### @param entry the data entered by the user. +### @return the modified entry that is to be passed back to iKog. +def modifyUserInput(entry): + return entry.replace("SB", "Steve Butler") + +### Called when a short version of a task is displayed to the screen +### @param text the text that is to be written +### @return the actual text that will be displayed by iKog. +def modifyShortOutput(text): + return "[modifyShortOutput] " + text + " [/modifyShortOutput]" + +### Called when a verbose version of a task is displayed to the screen +### @param text the text that is to be written +### @return the actual text that will be displayed by iKog. +def modifyVerboseOutput(text): + return "[modifyVerboseOutput] " + text + " [/modifyVerboseOutput]" + +### Called when html tasks are written to file for displaying in a browser. +### This is called for tasks when they are written to the file. +### @param text the text that is to be written +### @return the actual text that will be written by iKog. +def modifyFileOutput(text): + return "[modifyFileOutput] " + text + " [/modifyFileOutput]" + +### Called when html is written to file for displaying a browser. +### This is used for html text other than the task lines. +### @param text the text that is to be written +### @return the actual text that will be written by iKog. +def modifyFileOutputHtml(text): + return "[modifyFileOutputHtml] " + text + "[/modifyFileOutputHtml]" + + +### Called when text is to be displayed to the console +### Warning. This applies to more than just tasks. The filter +### text is also written via this method. +### @param text the text that is to be written +### @return the actual text that will be displayed by iKog. +def modifyOutput(text): + if text.startswith("Filter"): + return "[modifyOutput filter] " + text + " [/modifyOutput filter]" + else: + return "[modifyOutput std] " + text + " [/modifyOutput std]" + + +### Called when the html header is written to file. +### return True if you want the standard header written. False if you +### are doing your own part of the postHtmlHeader() function. +def showHeader(): + return True + +### Called just after the html header is written. See also showHeader() +### @return the text you want to write. +def postHtmlHeader(): + return "[postHtmlHeader][/postHtmlHeader]" + +### Called when the html footer is written to file. +### return True if you want the standard footer written. False if you +### are doing your own as part of the preHtmlFooter() function. +def showFooter(): + return True + +### Called just before the html footer is written. See also showFooterr() +### @return the text you want to write. +def preHtmlFooter(): + return "[preHtmlFooter][/preHtmlFooter]" + -- 2.45.1