|
Revision 423, 0.8 kB
(checked in by cneumann, 2 years ago)
|
changed: - improved formatting of description text for comments
and inclusion into runtime.
- moved description for class Foo into FooBase?.cpp
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 |
|
|---|
| 2 |
import logging; |
|---|
| 3 |
|
|---|
| 4 |
class TemplateWriter: |
|---|
| 5 |
"""Simple helper for writing a filled template. |
|---|
| 6 |
""" |
|---|
| 7 |
|
|---|
| 8 |
def __init__(self, fileName, filledTemplate): |
|---|
| 9 |
"""Creates a new TemplateWriter to write filledTemplate to fileName. |
|---|
| 10 |
""" |
|---|
| 11 |
self.m_log = logging.getLogger("TemplateWriter"); |
|---|
| 12 |
self.m_fileName = fileName; |
|---|
| 13 |
self.m_filledTemplate = filledTemplate; |
|---|
| 14 |
|
|---|
| 15 |
def write(self): |
|---|
| 16 |
"""Writes the filled template to the file (both specified in the |
|---|
| 17 |
constructor. |
|---|
| 18 |
""" |
|---|
| 19 |
self.m_log.debug("write: Opening file \"%s\"." % self.m_fileName); |
|---|
| 20 |
fileObj = open(self.m_fileName, "w"); |
|---|
| 21 |
|
|---|
| 22 |
self.m_log.debug("write: writing template."); |
|---|
| 23 |
fileObj.writelines(self.m_filledTemplate); |
|---|
| 24 |
|
|---|
| 25 |
self.m_log.debug("write: closing file."); |
|---|
| 26 |
fileObj.close(); |
|---|
| 27 |
|
|---|