def write_output(filepath, pack, filename, content):
if (filepath and filepath != '<STR_LIT:.>'<EOL>and not os.path.exists(os.path.join(filepath, pack))):<EOL><INDENT>os.makedirs(os.path.join(filepath, pack))<EOL><DEDENT>destination = os.path.join(filepath, pack, filename)<EOL>with io.open(destination, '<STR_LIT:w>', encoding='<STR_LIT:utf-8>') as f:<EOL><INDENT>f.write(content)<EOL><DEDENT>return destination<EOL>
Write content to filepath+pack+filename, create filepath if it does not
allready exists.

This an helper to automatically rewrite HTML outputs when needed during
development.

Beware, using this will lose every templating instructions previously
written in output attempts.