@contextmanager<EOL><INDENT>def output_to_relative_path(self, relative_path):<EOL><DEDENT>
full_path = os.path.join(self.target_folder_path, relative_path)<EOL>directory = os.path.dirname(full_path)<EOL>if not os.path.exists(directory):<EOL><INDENT>self.logger.info('<STR_LIT>', directory)<EOL>os.makedirs(directory)<EOL><DEDENT>self.logger.info('<STR_LIT>', full_path)<EOL>self.clear_output_buffer()<EOL>yield<EOL>with open(full_path, '<STR_LIT:wb>') as f:<EOL><INDENT>f.write(self.output_buffer_to_string().encode('<STR_LIT:utf-8>'))<EOL><DEDENT>self.clear_output_buffer()<EOL>
Sets up backend so that all emits are directed towards the new file
created at :param:`relative_path`.

Clears the output buffer on enter and exit.