Changeset 263

Show
Ignore:
Timestamp:
Mon Aug 28 16:36:48 2006
Author:
drew
Message:

- minor enhancements to xix-coverage script
- got rid of phole module (which was an inside joke to start with)

Files:

Legend:

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

    r262 r263  
    10 10 import lxml.etree as ET  
    11 11  
    12   import os, sys  
      12 import os, sys, time  
      13 from datetime import datetime  
    13 14 from shutil import copy2, copytree, rmtree  
    14 15 from glob import glob  
    15   from xix.utils.phole import getoutput, resource_filename  
      16 from xix import getoutput, resource_filename  
    15 16 from StringIO import StringIO  
    16 17  
     
    30 31         os.mkdir(path)  
    31 32  
      33 def utcasctime():  
      34     dt = datetime.utcnow()  
      35     asctime = time.asctime(dt.utctimetuple())  
      36     return asctime  
      37  
    32 38 def prepare_fs(source, copy_compiled=True, exclude=[], depends=[]):  
    33 39     target = '.xcoverage'  
     
    95 101 <xsl:output method="html"/>  
    96 102 <xsl:param name="packagename"/>  
      103 <xsl:param name="utctime"/>  
    97 104 <xsl:template match="/">  
    98 105     <html><head><title>Coverage Report for <xsl:value-of select="$packagename"/></title>  
     
    117 124     </xsl:for-each>  
    118 125     </table>  
      126     <div id="colophon">Report generated on <xsl:value-of select="$utctime"/> GMT<br/>  
      127     xix-coverage.py (<a href="http://xix.python-hosting.com">http://xix.python-hosting.com</a>)<br/>  
      128     coverage.py (<a href="http://www.nedbatchelder.com/code/modules/coverage.html">  
      129     http://www.nedbatchelder.com/code/modules/coverage.html</a>)<br/>  
      130     (C) 2006 Drew Smathers &lt;drew smathers at gmail com&gt;<br/>  
      131     </div>  
    119 132     </body></html>  
    120 133 </xsl:template>  
     
    129 142         xslt = ET.parse(open(reportXSLT))  
    130 143     transform = ET.XSLT(xslt)  
    131       html = transform(xml, packagename="'%s'" % source)  
      144     html = transform(xml, packagename="'%s'" % source, utctime="'%s'" % utcasctime())  
    131 144     fd = open(pj(reportdir, 'index.html'), 'w')  
    132 145     html.write(fd)  
  • trunk/xix/__init__.py

    r257 r263  
    2 2 from xix.utils.config import configFactory  
    3 3 import os  
    4   from xix.utils.phole import resource_filename  
    5 4  
    6 5 pj = os.path.join  
    7 6 dir = os.path.dirname  
    8 7  
      8 #############################################################  
      9 # BEGIN xplat and dependency reduction hacks  
      10 # Adataptor for folks who are too lazy to install setuptools  
      11 try:  
      12     from pkg_resources import resource_filename  
      13 except:  
      14     import os, sys  
      15     def resource_filename(name, relname):  
      16         root = os.path.split(sys.modules[name].__file__)[0]  
      17         fname = os.path.abspath(os.path.join(root, relname))  
      18         return fname  
      19 # win32 adaptor for getoutput from commands module  
      20 from commands import getoutput  
      21 if os.sys.platform in ('win32', 'nt'):  
      22     def getoutput(cmd):  
      23         output = os.popen2(cmd)[1]  
      24         return output.read()  
      25 # END  
      26 ##############################################################  
      27      
    9 28 #configFactory.addResource('app.cfg', pj(dir(__file__), '__app__.cfg'))  
    10 29 configFactory.addResource('app.cfg', resource_filename(__name__, '__app__.cfg'))  
     
    14 33 configFactory.addResource('xix.utils.rules', config=_cfg.xix.utils.rules)  
    15 34  
      35  
  • trunk/xix/data/coverage.css

    r257 r263  
    58 58     margin-right: 5px;  
    59 59     background-color: #ef5;  
    60   }  
      60 }  
      61  
      62 #colophon {  
      63     border-top: 1px solid;  
      64     background-color: #eee;  
      65     display: block;  
      66     position: relative;  
      67     bottom: 0px;  
      68     padding: 8px;  
      69     float: bottom;  
      70     width: 100%;  
      71     margin-top: 20px;  
      72     font-size: 75%;  
      73     text-align: center;  
      74 }