Wire up more Application apis
[osm/N2VC.git] / juju / client / codegen.py
1 from io import StringIO
2 from textwrap import indent
3
4
5 class CodeWriter(StringIO):
6 INDENT = " "
7
8 CLASS = 0
9 METHOD = 1
10
11 def write(self, msg, depth=0):
12 if depth:
13 prefix = self.INDENT * depth
14 msg = indent(msg, prefix)
15
16 return super(CodeWriter, self).write(msg)
17
18 def __str__(self):
19 return super(CodeWriter, self).getvalue()