# Set the queue consumers
- code.insert_newline()
+ code()
for port in self.in_ports:
code('${{port.code}}.setConsumer(this);')
# Set the queue descriptions
- code.insert_newline()
+ code()
for port in self.in_ports:
code('${{port.code}}.setDescription("[Version " + to_string(m_version) + ", $ident, $port]");')
# Initialize the transition profiling
- code.insert_newline()
+ code()
for trans in self.transitions:
# Figure out if we stall
stall = False
if args:
self.__call__(args)
- def indent(self):
- self._indent_level += self._indent_spaces
+ def indent(self, count=1):
+ self._indent_level += self._indent_spaces * count
- def dedent(self):
- assert self._indent_level >= self._indent_spaces
- self._indent_level -= self._indent_spaces
+ def dedent(self, count=1):
+ assert self._indent_level >= (self._indent_spaces * count)
+ self._indent_level -= self._indent_spaces * count
def fix(self, status):
previous = self._fix_newlines
initial_newline = False
- def insert_newline(self):
- self._data.append('\n')
+ def __call__(self, *args, **kwargs):
+ if not args:
+ self._data.append('\n')
+ return
+
+ format = args[0]
+ args = args[1:]
- def __call__(self, format, *args, **kwargs):
frame = inspect.currentframe().f_back
l = lookup(self, frame, *args, **kwargs)