add_comment() and work in progress for the new GraphViz framework

svn: r9679
This commit is contained in:
Stéphane Charette
2008-01-02 08:43:19 +00:00
parent a8a6c017e6
commit 95496e6449
6 changed files with 282 additions and 23 deletions

View File

@@ -270,6 +270,23 @@ class GVDocBase(BaseDoc.BaseDoc,BaseDoc.GVDoc):
self.write('\n')
def add_comment(self, comment):
"""
Add a comment.
Implementes BaseDoc.GVDoc.add_comment().
"""
tmp = comment.split('\n')
for line in tmp:
text = line.strip()
print 'text="%s"\n' % text
if text == "":
self.write('\n')
elif text.startswith('#'):
self.write('%s\n' % text)
else:
self.write('# %s\n' % text)
def start_subgraph(self,id):
self.write(' subgraph cluster_%s\n' % id)
self.write(' {\n')