/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/plugins/news_merge/parser.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
simple_parse's docstring).
25
25
"""
26
26
 
27
 
from __future__ import absolute_import
28
 
 
29
 
 
30
 
def simple_parse_lines(lines):
31
 
    """Same as simple_parse, but takes an iterable of strs rather than a single
32
 
    str.
33
 
    """
34
 
    return simple_parse(''.join(lines))
35
 
 
36
27
 
37
28
def simple_parse(content):
38
29
    """Returns blocks, where each block is a 2-tuple (kind, text).
39
 
 
 
30
    
40
31
    :kind: one of 'heading', 'release', 'section', 'empty' or 'text'.
41
32
    :text: a str, including newlines.
42
33
    """
68
59
    import sys
69
60
    content = open(sys.argv[1], 'rb').read()
70
61
    for result in simple_parse(content):
71
 
        print(result)
 
62
        print result