      """
      from django.utils.text import truncate_words
      try:
          length = int(arg)
      except ValueError: # invalid literal for int()
          return value # Fail silently.
      return truncate_words(value, length)
  truncatewords = stringfilter(truncatewords)
  
  def truncatewords_html(value, arg):
 
</s> remove     Argument: Number of words to truncate after
 </s> add     Argument: Number of words to truncate after. </s> remove     Argument: Number of words to truncate after
 </s> add     Argument: Number of words to truncate after. </s> remove     Truncates HTML after a certain number of words
 </s> add     Truncates HTML after a certain number of words. </s> remove     "Returns the length of the value - useful for lists"
 </s> add     """Returns the length of the value - useful for lists.""" </s> remove     except ValueError: # invalid string that's not a number
 </s> add     except ValueError: # Invalid string that's not a number.
    except ValueError: # Invalid literal for int().
      """
      from django.utils.text import truncate_words
      try:
          length = int(arg)
    except ValueError: # Invalid literal for int().
          return value # Fail silently.
      return truncate_words(value, length)
  truncatewords = stringfilter(truncatewords)
  
  def truncatewords_html(value, arg):
keep keep keep keep 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