  ###################
  
  def filesizeformat(bytes):
      """
      Format the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB, 102
      bytes, etc).
      """
      try:
          bytes = float(bytes)
      except TypeError:
          return u"0 bytes"
 
</s> remove         except TypeError: # len() of unsized object
 </s> add         except TypeError: # len() of unsized object. </s> remove     "Joins a list with a string, like Python's ``str.join(list)``"
 </s> add     """Joins a list with a string, like Python's ``str.join(list)``.""" </s> remove     except ValueError: # unpack list of wrong size (no "maybe" value provided)
 </s> add     except ValueError:
        # Unpack list of wrong size (no "maybe" value provided). </s> remove     except TypeError: # value isn't a string or a number; maybe it's a list?
 </s> add     except TypeError: # Value isn't a string or a number; maybe it's a list? </s> remove     Left-aligns the value in a field of a given width
 </s> add     Left-aligns the value in a field of a given width.
    Formats the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB,
    102 bytes, etc).
  ###################
  
  def filesizeformat(bytes):
      """
    Formats the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB,
    102 bytes, etc).
    Formats the value like a 'human-readable' file size (i.e. 13 KB, 4.1 MB,
    102 bytes, etc).
      """
      try:
          bytes = float(bytes)
      except TypeError:
          return u"0 bytes"
keep keep keep keep replace replace keep keep keep keep keep
 Style and import fixes.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6641 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/template/defaultfilters.py