code: def write_file(self, file):
          
  
          LOGGER.debug("> Writing '{0}' file.".format(file))
          writer = foundations.io.File(file)
          writer.content = [self.toPlainText().toUtf8()]
          if writer.write():
              self.set_file(file)
  
              self.file_saved.emit()
              return True
docs: Writes the editor file content into given file.
  
          :param file: File to write.
          :type file: unicode
          :return: Method success.
          :rtype: bool