<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_file(self, file):
 """ Writes the editor file content into given file. :param file: File to write. :type file: unicode :return: Method success. :rtype: bool """


        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