parameters: (self, path)
return_statement: return result
docstring: Save buffers contents to disk
          @param path: path of file to save
          @return: whether file was written or not
docstring_summary: Save buffers contents to disk
          @param path: path of file to save
          @return: whether file was written or not
docstring_tokens: Save buffers contents to disk @param path : path of file to save @return : whether file was written or not
function: def SaveFile(self, path):
          """Save buffers contents to disk
          @param path: path of file to save
          @return: whether file was written or not
  
          """
          result = True
          try:
              tlw_id = self.TopLevelParent.Id
              ed_msg.PostMessage(ed_msg.EDMSG_FILE_SAVE,
                                 (path, self.GetLangId()), tlw_id)
              self.File.SetPath(path)
              self.LOG("[ed_stc][info] Writing file %s, with encoding %s" % \
                       (path, self.File.GetEncoding()))
  
              if _PGET('AUTO_TRIM_WS', 'bool', False):
                  self.TrimWhitespace()
  
              if self.File.IsReadOnly():
                  wx.MessageBox(_("File is Read Only and cannot be saved"),
                                _("Read Only"),
                                style=wx.OK|wx.CENTER|wx.ICON_WARNING)
                  return True
              else:
                  if not self.File.IsRawBytes():
                      self.File.Write(self.GetText())
                  else:
                      nchars = self.GetTextLength()
                      txt = self.GetStyledText(0, nchars)[0:nchars*2:2]
                      self.File.Write(txt)
          except Exception, msg:
              result = False
              self.LOG("[ed_stc][err] There was an error saving %s" % path)
              self.LOG("[ed_stc][err] ERROR: %s" % str(msg))
  
          if result:
              self.SetSavePoint()
              self.SetModTime(ebmlib.GetFileModTime(path))
              self.File.FireModified()
              self.SetFileName(path)
  
          wx.CallAfter(ed_msg.PostMessage,
                       ed_msg.EDMSG_FILE_SAVED,
                       (path, self.GetLangId()),
                       tlw_id)
  
          return result
function_tokens: def SaveFile ( self , path ) : result = True try : tlw_id = self . TopLevelParent . Id ed_msg . PostMessage ( ed_msg . EDMSG_FILE_SAVE , ( path , self . GetLangId ( ) ) , tlw_id ) self . File . SetPath ( path ) self . LOG ( "[ed_stc][info] Writing file %s, with encoding %s" % ( path , self . File . GetEncoding ( ) ) ) if _PGET ( 'AUTO_TRIM_WS' , 'bool' , False ) : self . TrimWhitespace ( ) if self . File . IsReadOnly ( ) : wx . MessageBox ( _ ( "File is Read Only and cannot be saved" ) , _ ( "Read Only" ) , style = wx . OK | wx . CENTER | wx . ICON_WARNING ) return True else : if not self . File . IsRawBytes ( ) : self . File . Write ( self . GetText ( ) ) else : nchars = self . GetTextLength ( ) txt = self . GetStyledText ( 0 , nchars ) [ 0 : nchars * 2 : 2 ] self . File . Write ( txt ) except Exception , msg : result = False self . LOG ( "[ed_stc][err] There was an error saving %s" % path ) self . LOG ( "[ed_stc][err] ERROR: %s" % str ( msg ) ) if result : self . SetSavePoint ( ) self . SetModTime ( ebmlib . GetFileModTime ( path ) ) self . File . FireModified ( ) self . SetFileName ( path ) wx . CallAfter ( ed_msg . PostMessage , ed_msg . EDMSG_FILE_SAVED , ( path , self . GetLangId ( ) ) , tlw_id ) return result