from string import Template


class Subber():

    def __init__(self, subs):
        self.subs = subs

    def sub(self, infile, outfile):
        with open(infile) as template:
            lines = template.readlines()
            data = ''.join(lines)

        outfile.write(Template(data).safe_substitute(self.subs))
