3
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
4
__cvsid__ = "$Id: document.py,v 1.5 2004/02/13 02:47:58 PKO Exp $"
5
__revision__ = "$Revision: 1.5 $"[11:-2]
13
def __init__(self, filename=None):
14
"""Create a Document instance."""
15
self.filename = filename
21
self.filepath = os.path.realpath(self.filename)
22
self.filedir, self.filename = os.path.split(self.filepath)
23
self.filebase, self.fileext = os.path.splitext(self.filename)
26
"""Return contents of file."""
27
if self.filepath and os.path.exists(self.filepath):
28
f = file(self.filepath, 'rb')
36
def write(self, text):
37
"""Write text to file."""
39
f = file(self.filepath, 'wb')