From: Ansgar Burchardt Date: Sat, 22 Sep 2012 07:58:03 +0000 (+0200) Subject: daklib/command.py: quote section we are processing in reply X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4faa53e1827ecb6441d5d6a50f6fd7bf8668404;p=dak daklib/command.py: quote section we are processing in reply --- diff --git a/daklib/command.py b/daklib/command.py index cbaffa8f..fcf4cbb3 100644 --- a/daklib/command.py +++ b/daklib/command.py @@ -59,17 +59,23 @@ class CommandFile(object): session.add(signature_history) session.commit() + def _quote_section(self, section): + lines = [] + for l in str(section).splitlines(): + lines.append("> {0}".format(l)) + return "\n".join(lines) + def _evaluate_sections(self, sections, session): session.rollback() try: while True: sections.next() section = sections.section + self.result.append(self._quote_section(section)) action = section.get('Action', None) if action is None: raise CommandError('Encountered section without Action field') - self.result.append('Action: {0}'.format(action)) if action == 'dm': self.action_dm(self.fingerprint, section, session)