diff -r 8b633782f02d -r 86b05c0ab5cd bind_conf.py --- a/bind_conf.py Thu Apr 02 22:52:26 2009 +0300 +++ b/bind_conf.py Thu Apr 02 23:59:31 2009 +0300 @@ -32,8 +32,8 @@ @param comment optional comments """ - Object.__init__(comment) - conf.File.__init__(name, path) + Object.__init__(self, comment) + conf.File.__init__(self, name, path) # init self.objects = [] @@ -51,6 +51,21 @@ # various aliases... add_comment = add_record = add_directive = add_obj + def fmt_lines (self) : + """ + Just format all our objects + """ + + # prefix comments + for line in self._fmt_comments() : + yield line + + # and then all objects + for obj in self.objects : + # ...and their lines + for line in obj.fmt_lines() : + yield line + class Comment (Object) : """ A comment, is, well, a comment :) @@ -176,7 +191,7 @@ # then format the line # XXX: TTL? - yield "%30s %4s%4s %8s %s" % (self.label if self.label is not None else '', str(self.ttl) if self.ttl else '', self.cls, self.type, self.rdata) + yield "%-30s %-4s%-4s %-8s %s" % (self.label if self.label is not None else '', str(self.ttl) if self.ttl else '', self.cls, self.type, self.rdata) class SOA (ResourceRecord) : """