File: update_setup_cfg.py

package info (click to toggle)
python-apptools 3.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,480 kB
  • ctags: 3,990
  • sloc: python: 15,015; xml: 68; ansic: 38; makefile: 14; sh: 5
file content (28 lines) | stat: -rwxr-xr-x 613 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python

# Helper script to make it easier to maintain the tests run by
# $ python setup.py test
#
# Run this script when changing the entries of tests at the end of 
# setup.cfg.  This script will only change the line
#   tests = ....
# in setup.cfg.

tests = []

for line in open('setup.cfg'):
    if line.startswith('# test '):
        tests.append(line[6:].strip())

out = []

for line in open('setup.cfg'):
    if line.startswith('tests ='):
        out.append('tests = %s\n' % ','.join(tests))
    else:
        out.append(line)


fo = open('setup.cfg', 'w')
fo.write(''.join(out))
fo.close()