WriteHeader

def WriteHeader(self):
    # Read in the .h template file
    with open("templates/header.htf") as inputFile:
        headerTemplate = string.Template(inputFile.read())
    inputFile.close()

    # Substitute the new strings with the template tags
    headerFile = headerTemplate.substitute( module=self.moduleName,
                                            author=self.author,
                                            date=self.date,
                                            company=self.company,
                                            fileMacro=self.moduleName.upper())

    # Write out to header file
    self.mkdir_p(self.outputPath)
    with open(self.outputPath + self.moduleName.lower() + ".h", "w") as outputFile:
        outputFile.write(headerFile)
    outputFile.close()

Share >