'Write a file to the given path.  If ``content`` is given then
that text is written, otherwise the file in ``frompath`` is
used.  ``frompath`` is relative to ``self.template_path``'

def writefile(self, path, content=None, frompath=None):

    full = os.path.join(self.base_path, path)
    if (not os.path.exists(os.path.dirname(full))):
        os.makedirs(os.path.dirname(full))
    f = open(full, 'wb')
    if (content is not None):
        f.write(content)
    if (frompath is not None):
        if self.template_path:
            frompath = os.path.join(self.template_path, frompath)
        f2 = open(frompath, 'rb')
        f.write(f2.read())
        f2.close()
    f.close()
    return FoundFile(self.base_path, path)
