def non_fiscal_printout(self, lines, systemno='', nonfiscalheader='yes'): cmd = E.nonfiscalprintout('', systemno=systemno, nonfiscalheader=nonfiscalheader) for line in lines: if isinstance(line, collections.Mapping): text = line.pop('text', '') cmd.append(E.line(text, **line)) else: # Just a text line cmd.append(E.line(line)) self.send_command(cmd, check_for_errors=True)