]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wx/py/document.py
   3 __author__ 
= "Patrick K. O'Brien <pobrien@orbtech.com>" 
   5 __revision__ 
= "$Revision$"[11:-2] 
  19     def __init__(self
, filename
=None): 
  20         """Create a Document instance.""" 
  21         self
.filename 
= filename
 
  27             self
.filepath 
= os
.path
.realpath(self
.filename
) 
  28             self
.filedir
, self
.filename 
= os
.path
.split(self
.filepath
) 
  29             self
.filebase
, self
.fileext 
= os
.path
.splitext(self
.filename
) 
  32         """Return contents of file.""" 
  33         if self
.filepath 
and os
.path
.exists(self
.filepath
): 
  34             f 
= file(self
.filepath
, 'rb') 
  42     def write(self
, text
): 
  43         """Write text to file.""" 
  45             f 
= file(self
.filepath
, 'wb')