/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/__init__.py

Merge require_testtools_0.9.5_for_selftest to reflect test requirment and resolve news conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
666
666
    def _finished_reading(self):
667
667
        """See SmartClientMediumRequest._finished_reading."""
668
668
        pass
 
669
 
 
670
 
 
671
def unhtml_roughly(maybe_html, length_limit=1000):
 
672
    """Very approximate html->text translation, for presenting error bodies.
 
673
 
 
674
    :param length_limit: Truncate the result to this many characters.
 
675
 
 
676
    >>> unhtml_roughly("<b>bad</b> things happened\\n")
 
677
    ' bad  things happened '
 
678
    """
 
679
    return re.subn(r"(<[^>]*>|\n|&nbsp;)", " ", maybe_html)[0][:length_limit]