~ubuntu-branches/ubuntu/utopic/python-chaco/utopic

« back to all changes in this revision

Viewing changes to update_setup_cfg.py

  • Committer: Bazaar Package Importer
  • Author(s): Varun Hiremath
  • Date: 2011-04-06 19:03:54 UTC
  • mfrom: (7.2.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110406190354-rwd55l2ezjecfo41
Tags: 3.4.0-2
d/rules: fix pyshared directory path (Closes: #621116)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
 
3
 
# Helper script to make it easier to maintain the tests run by
4
 
# $ python setup.py test
5
 
#
6
 
# Run this script when changing the entries of tests at the end of 
7
 
# setup.cfg.  This script will only change the line
8
 
#   tests = ....
9
 
# in setup.cfg.
10
 
 
11
 
tests = []
12
 
 
13
 
for line in open('setup.cfg'):
14
 
    if line.startswith('# test '):
15
 
        tests.append(line[6:].strip())
16
 
 
17
 
out = []
18
 
 
19
 
for line in open('setup.cfg'):
20
 
    if line.startswith('tests ='):
21
 
        out.append('tests = %s\n' % ','.join(tests))
22
 
    else:
23
 
        out.append(line)
24
 
 
25
 
 
26
 
fo = open('setup.cfg', 'w')
27
 
fo.write(''.join(out))
28
 
fo.close()