#!/usr/bin/env python

import sys

if len(sys.argv) != 4:
    print "Usage: $ wrap template.html content.html output.html"
    exit()

try:
    template = open(sys.argv[1], "r")
    content = open(sys.argv[2], "r")
    output = open(sys.argv[3], "w")

    for t in template:
        if t.rstrip() == "{.}":
            for c in content:
                output.write( c )
        else:
            output.write( t )
except:
    print "Ooops!"
    exit()

template.close()
content.close()
output.close()
