Author: ccahoon
Date: 2009-07-17 07:36:29 -0500 (Fri, 17 Jul 2009)
New Revision: 11263

Modified:
   django/branches/soc2009/http-wsgi-improvements/django/http/__init__.py
Log:
[soc2009/http-wsgi-improvements] Add docs that I missed from the patch and 
reformat HttpResponse.__str__. refs #6527

This and the previous revision on this branch appear to complete all the 
changes from #6527.

Modified: django/branches/soc2009/http-wsgi-improvements/django/http/__init__.py
===================================================================
--- django/branches/soc2009/http-wsgi-improvements/django/http/__init__.py      
2009-07-17 11:48:08 UTC (rev 11262)
+++ django/branches/soc2009/http-wsgi-improvements/django/http/__init__.py      
2009-07-17 12:36:29 UTC (rev 11263)
@@ -288,6 +288,7 @@
         if not content_type:
             content_type = "%s; charset=%s" % (settings.DEFAULT_CONTENT_TYPE,
                     self._charset)
+        # Expects content to be an iterable container or a string.
         self._container = [''.join(content)]
         if hasattr(content, 'close'):
             content.close()
@@ -301,8 +302,8 @@
 
     def __str__(self):
         """Full HTTP message, including headers."""
-        headers = ['%s: %s' % (k, v) for k, v in self._headers.values()]
-        return '\n'.join(headers) + '\n\n' + self.content
+        return '\n'.join(['%s: %s' % (k, v) for k, v in 
self._headers.values()]) \
+               + "\n\n" + self.content
 
     def _convert_to_ascii(self, *values):
         """Converts all values to ascii strings."""
@@ -414,7 +415,7 @@
         return str(chunk)
 
     def close(self):
-        "No-op that remains for backwards compatibility. Ref #6527"
+        "No-op. Remains for backwards compatibility. Refs #6527"
         pass
 
     # The remaining methods partially implement the file-like object interface.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to