/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 tools/capture_tree.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-11-16 18:59:44 UTC
  • mfrom: (7143.15.15 more-cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20181116185944-biefv1sub37qfybm
Sprinkle some PEP8iness.

Merged from https://code.launchpad.net/~jelmer/brz/more-cleanups/+merge/358611

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
import sys
12
12
import os
13
13
 
14
 
from bzrlib.trace import enable_default_logging
 
14
from breezy.trace import enable_default_logging
15
15
enable_default_logging()
16
 
from bzrlib.selftest.treeshape import capture_tree_contents
 
16
from breezy.selftest.treeshape import capture_tree_contents
17
17
 
18
18
def main(argv):
19
19
    # a lame reimplementation of pformat that splits multi-line
20
20
    # strings into concatenated string literals.
21
 
    print '['
 
21
    print('[')
22
22
    for tt in capture_tree_contents('.'):
23
23
        assert isinstance(tt, tuple)
24
 
        print '    (', repr(tt[0]) + ',',
 
24
        print('    (', repr(tt[0]) + ',', end=' ')
25
25
        if len(tt) == 1:
26
 
            print '),'
 
26
            print('),')
27
27
        else:
28
28
            assert len(tt) == 2
29
29
            val = tt[1]
30
 
            print
 
30
            print()
31
31
            if val == '':
32
 
                print "        ''"
 
32
                print("        ''")
33
33
            else:
34
34
                for valline in val.splitlines(True):
35
 
                    print '       ', repr(valline)
36
 
            print '    ),'
37
 
    print ']'
 
35
                    print('       ', repr(valline))
 
36
            print('    ),')
 
37
    print(']')
38
38
 
39
39
if __name__ == '__main__':
40
40
    sys.exit(main(sys.argv))