Update of /cvsroot/todo-manager/todo-manager/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv31461/plugins
Modified Files:
export_html.py export_text.py import_old.py
Log Message:
Yeh! the first commit in a looong while.
I have improved the plugin loading system in the following ways:
* The root 'todo-manager' directory is added to the import path so plugins can
now access every native module in the package.
* plugins no long have to be passed a reference to the plugin module.
Index: export_html.py
===================================================================
RCS file: /cvsroot/todo-manager/todo-manager/plugins/export_html.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- export_html.py 17 Dec 2002 02:00:17 -0000 1.6
+++ export_html.py 25 Sep 2003 19:11:53 -0000 1.7
@@ -7,6 +7,7 @@
# Export a task list to an HTML file
import time, re
+import tdmcalls
# HTML format
def save_html(tasks, file):
@@ -38,7 +39,7 @@
notes = p.sub('<BR>', task['Notes'])
# The function used to format time structures
- fmt = plugin.fmttime
+ fmt = tdmcalls.fmttime
file.write("<TR BGCOLOR=\"#DEDEDE\"><TD BGCOLOR=\"%s\" ALIGN=\"CENTER\">%d</TD><TD>"\
"%s %s%s</TD><TD ALIGN=\"CENTER\">%s</TD><TD ALIGN=\"RIGHT\">%s</TD>\n<TR>"\
Index: export_text.py
===================================================================
RCS file: /cvsroot/todo-manager/todo-manager/plugins/export_text.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- export_text.py 17 Dec 2002 02:00:17 -0000 1.6
+++ export_text.py 25 Sep 2003 19:11:53 -0000 1.7
@@ -7,6 +7,7 @@
# Export a task list to a text file
import string
+import tdmcalls
def save_text(tasks, file):
"""Save a task list to a plain text file with simple formating"""
@@ -23,8 +24,8 @@
for task in tasks:
file.write(string.ljust(str(task["Priority"]), 3))
file.write(string.ljust(task["Name"], 50))
- file.write(string.ljust(plugin.fmttime(task["DueDate"]), 10))
- file.write(string.ljust(plugin.fmttime(task["FinishedDate"]), 18))
+ file.write(string.ljust(tdmcalls.fmttime(task["DueDate"]), 10))
+ file.write(string.ljust(tdmcalls.fmttime(task["FinishedDate"]), 18))
if task["Notes"]:
file.write("\n note:%s" %task["Notes"])
file.write("\n\n")
Index: import_old.py
===================================================================
RCS file: /cvsroot/todo-manager/todo-manager/plugins/import_old.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- import_old.py 13 Nov 2002 17:24:20 -0000 1.5
+++ import_old.py 25 Sep 2003 19:11:53 -0000 1.6
@@ -7,6 +7,8 @@
# Import old ToDo Manager files (versions 0.20 - 0.25)
import pickle
+import plugin
+import tdmcalls
def load_old(file):
"""Loads ToDo Manager files from earlier versions"""
@@ -26,7 +28,7 @@
depend on the plugin to handle this either.
"""
if (key == "DueDate") or (key == "FinishedDate"):
- value = plugin.tdmcalls.strptime("%m/%d/%y %I:%M %p", value)
+ value = tdmcalls.strptime("%m/%d/%y %I:%M %p", value)
t[key] = value
|