]>
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] 
  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')