~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/capture_tree.py

  • Committer: Martin Pool
  • Date: 2005-10-04 11:13:33 UTC
  • mto: (1185.13.3)
  • mto: This revision was merged to the branch mainline in revision 1403.
  • Revision ID: mbp@sourcefrog.net-20051004111332-f7b8a6bd41b9fe22
- tweak capture_tree formatting

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    print '['
22
22
    for tt in capture_tree_contents('.'):
23
23
        assert isinstance(tt, tuple)
24
 
        print '  ('
25
 
        for val in tt:
 
24
        print '    (', repr(tt[0]) + ',',
 
25
        if len(tt) == 1:
 
26
            print '),'
 
27
        else:
 
28
            assert len(tt) == 2
 
29
            val = tt[1]
 
30
            print
26
31
            if val == '':
27
 
                print "    ''"
 
32
                print "        ''"
28
33
            else:
29
34
                for valline in val.splitlines(True):
30
 
                    print '   ', repr(valline)
31
 
            print '    ,'
32
 
        print '  ),'
 
35
                    print '       ', repr(valline)
 
36
            print '    ),'
33
37
    print ']'
34
38
 
35
39
if __name__ == '__main__':