Changeset 262

Show
Ignore:
Timestamp:
Sun Aug 27 18:16:26 2006
Author:
drew
Message:

- changed xix-coverage script to automatically copy over coverage.py

Files:

Legend:

Unmodified
Added
Removed
Modified
  • trunk/scripts/xix-coverage.py

    r261 r262  
    13 13 from shutil import copy2, copytree, rmtree  
    14 14 from glob import glob  
    15   #from commands import getoutput  
    16 15 from xix.utils.phole import getoutput, resource_filename  
    17 16 from StringIO import StringIO  
     
    54 53     cvg = pj(target, 'coverage.py')  
    55 54     if not os.path.exists(cvg):  
    56           copy2('coverage.py', cvg)  
    57    
    58   def sweepup(source):  
    59       for root, dirs, files in os.walk(source):  
    60           #target_dir = pj(target, root)  
    61           print root, dirs, files  
    62           cfiles = [ f for f in files if f[-6:] == ',cover' ]  
    63           for cf in cfiles:  
    64               print pj(root, cf)  
      55         copy2('.coverage.py', cvg)  
    65 56  
    66 57 def annotate(source):  
     
    144 135  
    145 136 def main(opts):  
    146       if not os.path.exists('coverage.py'):  
    147           print >> sys.stderr, 'coverage.py must be in working directory before running this script'  
    148           sys.exit(-1)  
      137     if not os.path.exists('.coverage.py'):  
      138         path = resource_filename('xix', pj('data', 'coverage.py'))  
      139         copy2(path, '.coverage.py')  
    149 140     prepare_fs(opts.source, opts.copy_compiled, opts.exclude_dirs, opts.depends)  
    150 141     _mkdir(opts.report_dir)  
     
    185 176     parser.add_option('-z', '--html-assets', dest='html_assets',  
    186 177             help='comma-separated list of css, image files etc. to copy to report directory')  
    187       parser.add_option('-C', '--clean', action='store_true', dest='sweepup',  
    188               help='cleanup generated coverage files in source directory')  
    189 178     options, args = parser.parse_args()  
    190       if options.sweepup:  
    191           sweepup(options.source)  
    192           sys.exit(0)  
    193 179     options.depends = [ _path(p) for p in options.depends.split(',') ]  
    194 180     options.exclude_dirs = options.exclude_dirs.split(',')  
  • trunk/setup.py

    r261 r262  
    16 16     packages=['xix', 'xix.utils', 'xix.utils.comp', 'xix.utils.tools'],  
    17 17     package_dir={'xix': 'xix'},  
    18       package_data={'xix': ['*.cfg', 'data/*.css', 'data/*.xsl']},  
      18     package_data={'xix': ['*.cfg', 'data/*.css', 'data/*.xsl', 'data/*.py']},  
    18 18     )