[PATCH 6/6] Clarify a comment

John Wright jsw at debian.org
Wed Jul 29 13:35:32 UTC 2009


From: John Wright <john at johnwright.org>

There was some confusion (marked with an XXX) in how the
trailing-whitespace-avoiding code worked.  This patch clarifies the
comment.
---
 debian_bundle/deb822.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/debian_bundle/deb822.py b/debian_bundle/deb822.py
index 3fffa4a..a71ffcc 100644
--- a/debian_bundle/deb822.py
+++ b/debian_bundle/deb822.py
@@ -332,10 +332,12 @@ class Deb822(Deb822Dict):
         else:
             return_string = False
         for key, value in self.iteritems():
+            # We want one space between the "Field:" and value, unless
+            # value starts with a newline (i.e. the value itself started on
+            # the line *after* the field name in the control file), or is
+            # empty.  In that case, we avoid trailing whitespace by by not
+            # including a space after the colon.
             if not value or value[0] == '\n':
-                # Avoid trailing whitespace after "Field:" if it's on its own
-                # line or the value is empty
-                # XXX Uh, really print value if value == '\n'?
                 fd.write('%s:%s\n' % (key, value))
             else:
                 fd.write('%s: %s\n' % (key, value))
-- 
1.6.3.3




More information about the pkg-python-debian-discuss mailing list