equal
deleted
inserted
replaced
6 |
6 |
7 class ConfObject (object) : |
7 class ConfObject (object) : |
8 """ |
8 """ |
9 An object that can be written to a ConfFile, as multiple lines of text. |
9 An object that can be written to a ConfFile, as multiple lines of text. |
10 """ |
10 """ |
|
11 |
|
12 def __init__ (self, comments=None) : |
|
13 """ |
|
14 Initialize with the given list of comments. Comments that are None should be ignore. |
|
15 """ |
|
16 |
|
17 # init the comments list |
|
18 self.comments = comments or [] |
|
19 |
|
20 def add_comment (self, comment) : |
|
21 """ |
|
22 Add a comment to be rendered in the output. |
|
23 """ |
|
24 |
|
25 # add it |
|
26 self.comments.append(comment) |
11 |
27 |
12 def fmt_lines (self) : |
28 def fmt_lines (self) : |
13 """ |
29 """ |
14 Yield a series of lines to be output in the file |
30 Yield a series of lines to be output in the file |
15 """ |
31 """ |