]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/command.py: quote section we are processing in reply
authorAnsgar Burchardt <ansgar@debian.org>
Sat, 22 Sep 2012 07:58:03 +0000 (09:58 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sat, 22 Sep 2012 07:58:03 +0000 (09:58 +0200)
daklib/command.py

index cbaffa8f3a206f2094fb298604ddec3eb94d761d..fcf4cbb391613df242762e022453af3cbd714a23 100644 (file)
@@ -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)