Ejemplo n.º 1
0
    def test_02(self):
        """Test_writeFileListTrippleAsTable.test_02(): writeFileListTrippleAsTable() - Single directory list"""
        myFileNameS = [
            'spam/beans.lis',
            'spam/chips.lis',
            'spam/eggs.lis',
        ]
        myFileLinkS = [(f, HtmlUtils.retHtmlFileName(f), 'Link text {:d}'.format(i)) for i, f in enumerate(myFileNameS)]
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeFileListTrippleAsTable(myS, myFileLinkS, {}, False)
#         print()
#         print(myF.getvalue())
#         self.maxDiff = None
        self.assertEqual(myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <table>
    <tr>
      <td rowspan="3">spam/</td>
      <td> <a href="beans.lis_2cd7aad2a1a03013720d9cc5d83b860c.html">Link text 0</a></td>
    </tr>
    <tr>
      <td> <a href="chips.lis_78c24a9e68057387b3f7c7de7f57385d.html">Link text 1</a></td>
    </tr>
    <tr>
      <td> <a href="eggs.lis_afc193e8de9a2e06454b4bf92d5fefd8.html">Link text 2</a></td>
    </tr>
  </table>
</html>
""")
Ejemplo n.º 2
0
    def test_01(self):
        """Test_writeFileListTrippleAsTable.test_01(): writeFileListTrippleAsTable() - Single file list"""
        myFileNameS = [
            '0eggs.lis',
            '1chips.lis',
            '2beans.lis',
        ]
        myFileLinkS = [(f, HtmlUtils.retHtmlFileName(f), 'Link text {:d}'.format(i)) for i, f in enumerate(myFileNameS)]
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeFileListTrippleAsTable(myS, myFileLinkS, {}, False)
#         print()
#         print(myF.getvalue())
#         self.maxDiff = None
#        print(myFileLinkS)
        self.assertEqual(myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <table>
    <tr>
      <td> <a href="0eggs.lis_4656d29aa36ca0c168a10dd3ffe2c9fa.html">Link text 0</a></td>
    </tr>
    <tr>
      <td> <a href="1chips.lis_6cb5a1758e21dad3dba0cc4a53d91c31.html">Link text 1</a></td>
    </tr>
    <tr>
      <td> <a href="2beans.lis_961d8a2ab0ecf325e12f11c8bdbbf817.html">Link text 2</a></td>
    </tr>
  </table>
</html>
""")
Ejemplo n.º 3
0
def writeIncludeGraphAsText(theOutDir, theItu, theLexer):
    def _linkToIndex(theS, theItu):
        with XmlWrite.Element(theS, 'p'):
            theS.characters('Return to ')
            with XmlWrite.Element(theS, 'a',
                                  {'href': tuIndexFileName(theItu)}):
                theS.characters('Index')

    outPath = os.path.join(theOutDir, includeGraphFileNameText(theItu))
    with XmlWrite.XhtmlStream(outPath, mustIndent=INDENT_ML) as myS:
        with XmlWrite.Element(myS, 'head'):
            with XmlWrite.Element(
                    myS, 'link', {
                        'href': TokenCss.TT_CSS_FILE,
                        'type': "text/css",
                        'rel': "stylesheet",
                    }):
                pass
            with XmlWrite.Element(myS, 'title'):
                myS.characters('Included graph for %s' % theItu)
        with XmlWrite.Element(myS, 'body'):
            with XmlWrite.Element(myS, 'h1'):
                myS.characters('File include graph for: %s' % theItu)
            with XmlWrite.Element(myS, 'p'):
                myS.characters('A text dump of the include graph.')
            _linkToIndex(myS, theItu)
            with XmlWrite.Element(myS, 'pre'):
                myS.characters(str(theLexer.fileIncludeGraphRoot))
            _linkToIndex(myS, theItu)
Ejemplo n.º 4
0
    def test_01(self):
        """TestXhtmlWrite.test_01(): simple example."""
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as xS:
            with XmlWrite.Element(xS, 'head'):
                with XmlWrite.Element(xS, 'title'):
                    xS.characters(u'Virtual Library')
            with XmlWrite.Element(xS, 'body'):
                with XmlWrite.Element(xS, 'p'):
                    xS.characters(u'Moved to ')
                    with XmlWrite.Element(xS, 'a',
                                          {'href': 'http://example.org/'}):
                        xS.characters(u'example.org')
                    xS.characters(u'.')
        #print
        #print myF.getvalue()
        self.assertEqual(
            myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Virtual Library</title>
  </head>
  <body>
    <p>Moved to <a href="http://example.org/">example.org</a>.</p>
  </body>
</html>
""")
Ejemplo n.º 5
0
    def test_01(self):
        """Test_writeFileListTrippleAsTable.test_01(): writeFileListTrippleAsTable() - Single file list"""
        myFileNameS = [
            '0eggs.lis',
            '1chips.lis',
            '2beans.lis',
        ]
        myFileLinkS = [(f, HtmlUtils.retHtmlFileName(f),
                        'Link text {:d}'.format(i))
                       for i, f in enumerate(myFileNameS)]
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeFileListTrippleAsTable(myS, myFileLinkS, {}, False)
#         print()
#         print(myF.getvalue())
#         self.maxDiff = None
#         print(myFileLinkS)
        self.assertEqual(
            myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <table>
    <tr>
      <td> <a href="0eggs.lis_55d1c28c70fa11242791f484339eb1be.html">Link text 0</a></td>
    </tr>
    <tr>
      <td> <a href="1chips.lis_9d8f17f73fd3f595dcdc0d6cb43efee2.html">Link text 1</a></td>
    </tr>
    <tr>
      <td> <a href="2beans.lis_c191c76d1f99127750d4f05f0d47e101.html">Link text 2</a></td>
    </tr>
  </table>
</html>
""")
Ejemplo n.º 6
0
    def test_03(self):
        """TestXhtmlWrite.test_03(): writeHtmlFileAnchor()."""
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeHtmlFileAnchor(myS, 47, theText='Navigation text')
#        print()
#        print(myF.getvalue())
        self.assertEqual(myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <a name="47" />Navigation text</html>
""")
Ejemplo n.º 7
0
def _writeDirectoryIndexHTML(theInDir, theOutDir, titlePathTupleS, theJobSpec):
    """Writes a super index.html when a directory has been processed.
    titlePathTuples is a list of:
        PpProcessResult(ituPath, indexPath, tuIndexFileName(ituPath))."""
    indexPath = os.path.join(theOutDir, 'index.html')
    TokenCss.writeCssToDir(theOutDir)
    _prefixOut, titlePathTupleS = _removeCommonPrefixFromResults(
        titlePathTupleS)
    # Write the HTML
    with XmlWrite.XhtmlStream(indexPath, mustIndent=INDENT_ML) as myS:
        with XmlWrite.Element(myS, 'head'):
            with XmlWrite.Element(
                    myS, 'link', {
                        'href': TokenCss.TT_CSS_FILE,
                        'type': "text/css",
                        'rel': "stylesheet",
                    }):
                pass
            with XmlWrite.Element(myS, 'title'):
                myS.characters('CPIP Processing')
        with XmlWrite.Element(myS, 'body'):
            with XmlWrite.Element(myS, 'h1'):
                myS.characters('CPIP Directory Processing in output location: %s' \
                               % theOutDir)
            # List of links to TU index pages
            with XmlWrite.Element(myS, 'h2'):
                myS.characters('Files Processed as Translation Units:')
            with XmlWrite.Element(myS, 'p'):
                myS.characters('Input: ')
                with XmlWrite.Element(myS, 'tt'):
                    myS.characters(theInDir)
            with XmlWrite.Element(myS, 'ul'):
                for title, indexHTMLPath, fileIndexHTMLPath in titlePathTupleS:
                    if indexHTMLPath is not None \
                    and fileIndexHTMLPath is not None:
                        indexHTMLPath = os.path.relpath(
                            indexHTMLPath,
                            theOutDir,
                        )
                        # Redirect to page that describes actual file
                        indexHTMLPath = os.path.join(
                            os.path.dirname(indexHTMLPath), fileIndexHTMLPath)
                    with XmlWrite.Element(myS, 'li'):
                        with XmlWrite.Element(myS, 'tt'):
                            if indexHTMLPath is not None:
                                with XmlWrite.Element(myS, 'a',
                                                      {'href': indexHTMLPath}):
                                    myS.characters(title)
                            else:
                                myS.characters('%s [FAILED]' % title)
            _writeCommandLineInvocationToHTML(myS, theJobSpec)
Ejemplo n.º 8
0
    def test_00(self):
        """TestXhtmlWrite.test_00(): construction."""
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF):
            pass


#        print()
#        print(myF.getvalue())
        self.assertEqual(
            myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" />
""")
Ejemplo n.º 9
0
def processCppCondGrphToHtml(theLex, theHtmlPath, theTitle, theIdxPath):
    """Given the PpLexer write out the Cpp Cond Graph to the HTML file.

    :param theLex: The lexer.
    :type theLex: :py:class:`cpip.core.PpLexer.PpLexer`

    :param theHtmlPath: Path to output HTML file.
    :type theHtmlPath: ``str``

    :param theTitle: Title.
    :type theTitle: ``str``

    :param theIdxPath: Path to index page for back links.
    :type theIdxPath: ``str``

    :returns: ``NoneType``
    """
    if not os.path.exists(os.path.dirname(theHtmlPath)):
        os.makedirs(os.path.dirname(theHtmlPath))
    # Note: Callers responsibility to write the CSS file
    ## Write CSS
    #TokenCss.writeCssToDir(os.path.dirname(theHtmlPath))
    # Process the TU
    with XmlWrite.XhtmlStream(theHtmlPath, mustIndent=cpip.INDENT_ML) as myS:
        with XmlWrite.Element(myS, 'head'):
            with XmlWrite.Element(
                    myS, 'link', {
                        'href': TokenCss.TT_CSS_FILE,
                        'type': "text/css",
                        'rel': "stylesheet",
                    }):
                pass
            with XmlWrite.Element(myS, 'title'):
                myS.characters(theTitle)
        with XmlWrite.Element(myS, 'body'):
            with XmlWrite.Element(myS, 'h1'):
                myS.characters(
                    'Preprocessing Conditional Compilation Graph: %s' %
                    theLex.tuFileId)
            with XmlWrite.Element(myS, 'p'):
                myS.characters(
                    """The conditional compilation statements as green (i.e. evaluates as True)
and red (evaluates as False). Each statement is linked to the source code it came from.
""")
            linkToIndex(myS, theIdxPath)
            with XmlWrite.Element(myS, 'pre'):
                myVisitor = CcgVisitorToHtml(myS)
                theLex.condCompGraph.visit(myVisitor)
Ejemplo n.º 10
0
    def test_01(self):
        """TestXhtmlWrite.test_01(): writeHtmlFileLink() simple."""
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeHtmlFileLink(myS, 'spam/eggs/chips.lis', 47, theText='Navigation text', theClass=None)
#        print()
#        print(myF.getvalue())
#        self.maxDiff = None
        self.assertEqual("""<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <a href="chips.lis_5e410d3de8868d056cd4d3367f91e769.html#47">Navigation text</a>
</html>
""",
            myF.getvalue(),
        )
Ejemplo n.º 11
0
    def _convert(self):
        """Convert ITU to HTML.

        :returns: ``NoneType``

        :raises: ``ExceptionItuToHTML`` on failure.
        """
        # Create reader
        myItt = self._initReader()
        # Create writer and iterate
        if self._fOut is None:
            return
        try:
            with XmlWrite.XhtmlStream(self._fOut,
                                      mustIndent=cpip.INDENT_ML) as myS:
                with XmlWrite.Element(myS, 'head'):
                    with XmlWrite.Element(
                            myS, 'link', {
                                'href': TokenCss.TT_CSS_FILE,
                                'type': "text/css",
                                'rel': "stylesheet",
                            }):
                        pass
                    with XmlWrite.Element(myS, 'title'):
                        myS.characters('File: %s' % self._fpIn)
                with XmlWrite.Element(myS, 'body'):
                    with XmlWrite.Element(myS, 'h1'):
                        myS.characters('File: %s' % self._fpIn)
                    with XmlWrite.Element(myS, 'p'):
                        myS.characters(
                            """Green shading in the line number column
means the source is part of the translation unit, red means it is conditionally excluded.
Highlighted line numbers link to the translation unit page. Highlighted macros link to
the macro page.""")
                    with XmlWrite.Element(myS, 'pre'):
                        myS.xmlSpacePreserve()
                        self._incAndWriteLine(myS)
                        for t, tt in myItt.genTokensKeywordPpDirective():
                            self._handleToken(myS, t, tt)
        except (IOError) as err:
            raise ExceptionItuToHTML('%s line=%d, col=%d' \
                        % (
                            str(err),
                            myItt.fileLocator.lineNum,
                            myItt.fileLocator.colNum,
                        )
                    )
Ejemplo n.º 12
0
def writeIndexHtml(theItuS, theOutDir, theJobSpec):
    """Writes the top level index.html page for a pre-processed file.
    
    theOutDir - The output directory.
    
    theTuS - The list of translation units processed.
    
    theCmdLine - The command line as a string.
    
    theOptMap is a map of {opt_name : (value, help), ...} from the
    command line options.
    TODO: This is fine but has too many levels of indent.
    """
    indexPath = os.path.join(theOutDir, 'index.html')
    assert len(theItuS) == 1, 'Can only process one TU to an output directory.'
    with XmlWrite.XhtmlStream(indexPath, mustIndent=INDENT_ML) as myS:
        with XmlWrite.Element(myS, 'head'):
            with XmlWrite.Element(
                    myS, 'link', {
                        'href': TokenCss.TT_CSS_FILE,
                        'type': "text/css",
                        'rel': "stylesheet",
                    }):
                pass
            with XmlWrite.Element(myS, 'title'):
                myS.characters('CPIP Processing')
        with XmlWrite.Element(myS, 'body'):
            with XmlWrite.Element(myS, 'h1'):
                myS.characters('CPIP Processing in output location: %s' %
                               theOutDir)
            # List of links to TU index pages
            with XmlWrite.Element(myS, 'h2'):
                myS.characters('Files Processed as Translation Units:')
            with XmlWrite.Element(myS, 'ul'):
                for anItu in theItuS:
                    with XmlWrite.Element(myS, 'li'):
                        with XmlWrite.Element(myS, 'tt'):
                            with XmlWrite.Element(
                                    myS,
                                    'a',
                                {'href': tuIndexFileName(anItu)},
                            ):
                                myS.characters(anItu)
            _writeCommandLineInvocationToHTML(myS, theJobSpec)
    return indexPath
Ejemplo n.º 13
0
    def test_03(self):
        """Test_writeFileListAsTable.test_03(): writeFileListAsTable() - Multiple directory list"""
        myFileNameS = [
            'spam/eggs.lis',
            'spam/chips.lis',
            'spam/fishfingers/beans.lis',
            'spam/fishfingers/peas.lis',
        ]
        myFileLinkS = [(f, HtmlUtils.retHtmlFileName(f)) for f in myFileNameS]
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeFileListAsTable(myS, myFileLinkS, {}, False)
#         print()
#         print(myF.getvalue())
#         self.maxDiff = None
        self.assertEqual(
            myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <table>
    <tr>
      <td rowspan="4">spam/</td>
      <td colspan="2">
        <a href="chips.lis_cf88bd52fd64d0ee6dd7f9f7d465d22b.html">chips.lis</a>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <a href="eggs.lis_bc8a04943b99ef250322263f7f263272.html">eggs.lis</a>
      </td>
    </tr>
    <tr>
      <td rowspan="2">fishfingers/</td>
      <td>
        <a href="beans.lis_a50e730e7b0104f5a34f3aca74fd03b0.html">beans.lis</a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="peas.lis_08179aa1bc47182a36430dafec259742.html">peas.lis</a>
      </td>
    </tr>
  </table>
</html>
""")
Ejemplo n.º 14
0
    def test_03(self):
        """Test_writeFileListAsTable.test_03(): writeFileListAsTable() - Multiple directory list"""
        myFileNameS = [
            'spam/eggs.lis',
            'spam/chips.lis',
            'spam/fishfingers/beans.lis',
            'spam/fishfingers/peas.lis',
        ]
        myFileLinkS = [(f, HtmlUtils.retHtmlFileName(f)) for f in myFileNameS]
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeFileListAsTable(myS, myFileLinkS, {}, False)
#         print()
#         print(myF.getvalue())
#         self.maxDiff = None
        self.assertEqual(myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <table>
    <tr>
      <td rowspan="4">spam/</td>
      <td colspan="2">
        <a href="chips.lis_78c24a9e68057387b3f7c7de7f57385d.html">chips.lis</a>
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <a href="eggs.lis_afc193e8de9a2e06454b4bf92d5fefd8.html">eggs.lis</a>
      </td>
    </tr>
    <tr>
      <td rowspan="2">fishfingers/</td>
      <td>
        <a href="beans.lis_8c05f2bb7fd4e4946ceae7a0f0a658f1.html">beans.lis</a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="peas.lis_93ee5d4c29eb90269e47d1e20daa4110.html">peas.lis</a>
      </td>
    </tr>
  </table>
</html>
""")
Ejemplo n.º 15
0
    def test_05(self):
        """TestXhtmlWrite.test_05(): writeHtmlFileAnchor() with class and href."""
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeHtmlFileAnchor(myS, 47,
                                          theText='Navigation text',
                                          theClass='CSS_class',
                                          theHref='HREF_TARGET')
#        print()
#        print(myF.getvalue())
        self.assertEqual(myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <a name="47" />
  <a href="HREF_TARGET">
    <span class="CSS_class">Navigation text</span>
  </a>
</html>
""")
Ejemplo n.º 16
0
    def test_02(self):
        """TestXhtmlWrite.test_02(): writeHtmlFileLink() with class."""
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeHtmlFileLink(myS,
                                        'spam/eggs/chips.lis',
                                        47,
                                        theText='Navigation text',
                                        theClass='CSS_class')
#        print()
#        print(myF.getvalue())
#        self.maxDiff = None
        self.assertEqual(
            """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <a href="chips.lis_e62fa1654e1857c70203c398c0cbe27d.html#47">
    <span class="CSS_class">Navigation text</span>
  </a>
</html>
""", myF.getvalue())
Ejemplo n.º 17
0
    def test_02(self):
        """Test_writeFileListAsTable.test_02(): writeFileListAsTable() - Single directory list"""
        myFileNameS = [
            'spam/eggs.lis',
            'spam/chips.lis',
            'spam/beans.lis',
        ]
        myFileLinkS = [(f, HtmlUtils.retHtmlFileName(f)) for f in myFileNameS]
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeFileListAsTable(myS, myFileLinkS, {}, False)
#         print()
#         print(myF.getvalue())
#         self.maxDiff = None
        self.assertEqual(
            myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <table>
    <tr>
      <td rowspan="3">spam/</td>
      <td>
        <a href="beans.lis_85ae02d1d72c7fa819c834e55cd4b1c2.html">beans.lis</a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="chips.lis_cf88bd52fd64d0ee6dd7f9f7d465d22b.html">chips.lis</a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="eggs.lis_bc8a04943b99ef250322263f7f263272.html">eggs.lis</a>
      </td>
    </tr>
  </table>
</html>
""")
Ejemplo n.º 18
0
    def test_01(self):
        """Test_writeFileListAsTable.test_01(): writeFileListAsTable() - Single file list"""
        myFileNameS = [
            'eggs.lis',
            'chips.lis',
            'beans.lis',
        ]
        myFileLinkS = [(f, HtmlUtils.retHtmlFileName(f)) for f in myFileNameS]
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeFileListAsTable(myS, myFileLinkS, {}, False)
#         print()
#         print(myF.getvalue())
#         self.maxDiff = None
        self.assertEqual(
            myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <table>
    <tr>
      <td>
        <a href="beans.lis_0041e5194bf9f9efa9f26d5a2139a418.html">beans.lis</a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="chips.lis_cb7a31031b69325af0e4d341041c4844.html">chips.lis</a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="eggs.lis_66b549ff0dd23f61d7ea822aa9549756.html">eggs.lis</a>
      </td>
    </tr>
  </table>
</html>
""")
Ejemplo n.º 19
0
    def test_charactersWithBr_00(self):
        """TestXhtmlWrite.test_00(): simple example."""
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as xS:
            with XmlWrite.Element(xS, 'head'):
                pass
            with XmlWrite.Element(xS, 'body'):
                with XmlWrite.Element(xS, 'p'):
                    xS.charactersWithBr(u'No break in this line.')
                with XmlWrite.Element(xS, 'p'):
                    xS.charactersWithBr(u"""Several
breaks in
this line.""")
                with XmlWrite.Element(xS, 'p'):
                    xS.charactersWithBr(u'\nBreak at beginning.')
                with XmlWrite.Element(xS, 'p'):
                    xS.charactersWithBr(u'Break at end\n')
                with XmlWrite.Element(xS, 'p'):
                    xS.charactersWithBr(
                        u'\nBreak at beginning\nmiddle and end\n')
        #print
        #print myF.getvalue()
        self.assertEqual(
            myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head />
  <body>
    <p>No break in this line.</p>
    <p>Several<br />breaks in<br />this line.</p>
    <p><br />Break at beginning.</p>
    <p>Break at end<br /></p>
    <p><br />Break at beginning<br />middle and end<br /></p>
  </body>
</html>
""")
Ejemplo n.º 20
0
    def test_01(self):
        """Test_writeFileListAsTable.test_01(): writeFileListAsTable() - Single file list"""
        myFileNameS = [
            'eggs.lis',
            'chips.lis',
            'beans.lis',
        ]
        myFileLinkS = [(f, HtmlUtils.retHtmlFileName(f)) for f in myFileNameS]
        myF = io.StringIO()
        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeFileListAsTable(myS, myFileLinkS, {}, False)
#         print()
#         print(myF.getvalue())
#         self.maxDiff = None
        self.assertEqual(myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <table>
    <tr>
      <td>
        <a href="beans.lis_37fe59d50e21a22f770f96832a3316be.html">beans.lis</a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="chips.lis_52ff1ebbb6b180864516ab041e20da65.html">chips.lis</a>
      </td>
    </tr>
    <tr>
      <td>
        <a href="eggs.lis_1355f6695f856c9448c806cfa562a4c4.html">eggs.lis</a>
      </td>
    </tr>
  </table>
</html>
""")
Ejemplo n.º 21
0
def processTuToHtml(theLex, theHtmlPath, theTitle, theCondLevel, theIdxPath, incItuAnchors=True):
    """Processes the PpLexer and writes the tokens to the HTML file.
    
    *theHtmlPath*
        The path to the HTML file to write.
    
    *theTitle*
        A string to go into the <title> element.
    
    *theCondLevel*
        The Conditional level to pass to theLex.ppTokens()
        
    *theIdxPath*
        Path to link back to the index page.
        
    *incItuAnchors*
        boolean, if True will write anchors for lines in the ITU
        that are in this TU. If True then setItuLineNumbers returned is likely
        to be non-empty.
    
    Returns a pair of (PpTokenCount.PpTokenCount(), set(int))
    The latter is a set of integer line numbers in the ITU that are in the TU,
    these line numbers with have anchors in this HTML file of the form:
    <a name="%d" />."""
    if not os.path.exists(os.path.dirname(theHtmlPath)):
        os.makedirs(os.path.dirname(theHtmlPath))
    LINE_FIELD_WIDTH = 8
    LINE_BREAK_LENGTH = 100
    # Make a global token counter (this could be got from the file include graph
    # but this is simpler.
    myTokCntr = PpTokenCount.PpTokenCount()
    # Write CSS
    TokenCss.writeCssToDir(os.path.dirname(theHtmlPath))
    # Set of active lines of the ITU (only) that made it into the TU
    setItuLineNumbers = set()
    # Process the TU
    with XmlWrite.XhtmlStream(theHtmlPath, mustIndent=cpip.INDENT_ML) as myS:
        with XmlWrite.Element(myS, 'head'):
            with XmlWrite.Element(
                myS,
                'link',
                {
                    'href'  : TokenCss.TT_CSS_FILE,
                    'type'  : "text/css",
                    'rel'   : "stylesheet",
                    }
                ):
                pass
            with XmlWrite.Element(myS, 'title'):
                myS.characters(theTitle)
        myIntId = 0
        with XmlWrite.Element(myS, 'body'):
            with XmlWrite.Element(myS, 'h1'):
                myS.characters('Translation Unit: %s' % theLex.tuFileId)
            with XmlWrite.Element(myS, 'p'):
                myS.characters("""An annotated version of the translation unit
with minimal whitespace. Indentation is according to the depth of the #include stack.
Line numbers are linked to the original source code.
""")
            with XmlWrite.Element(myS, 'p'):
                myS.characters("""Highlighted filenames take you forward to the
next occasion in the include graph of the file being pre-processed, in this case: %s""" % theLex.tuFileId)
            linkToIndex(myS, theIdxPath)
            with XmlWrite.Element(myS, 'pre'):
                # My copy of the file stack for annotating the output
                myFileStack = []
                indentStr = ''
                colNum = 1
                for t in theLex.ppTokens(incWs=True, minWs=True, condLevel=theCondLevel):
                    #print t
                    logging.debug('Token: %s', str(t))
                    myTokCntr.inc(t, isUnCond=t.isUnCond, num=1)
                    if t.isUnCond:
                        # Adjust the prefix depending on how deep we are in the file stack
                        myIntId = _adjustFileStack(myS, theLex.fileStack, myFileStack, myIntId)
                        indentStr = '.' * len(myFileStack)
                        # Write the token
                        if t.tt == 'whitespace':
                            if t.t != '\n' and colNum > LINE_BREAK_LENGTH:
                                myS.characters(' \\\n')
                                myS.characters(indentStr)
                                myS.characters(' ' * (LINE_FIELD_WIDTH + 8))
                                colNum = 1
                            else:
                                # Line break
                                myS.characters(t.t)
                                ## NOTE: This is removed as the cost to the
                                ## browser is enormous.
                                ## Set a marker
                                #with XmlWrite.Element(myS,
                                #                      'a',
                                #                      {'name' : myTuI.add(theLex.tuIndex)}):
                                #    pass
                        else:
                            if colNum > LINE_BREAK_LENGTH:
                                # Force a break
                                myS.characters('\\\n')
                                myS.characters(indentStr)
                                myS.characters(' ' * (LINE_FIELD_WIDTH + 8))
                                colNum = 1
                            with XmlWrite.Element(myS, 'span',
                                            {'class' : TokenCss.retClass(t.tt)}):
                                myS.characters(t.t)
                                colNum += len(t.t)
                        if t.t == '\n' and len(myFileStack) != 0:
                            # Write an ID for the ITU only
                            if incItuAnchors and len(myFileStack) == 1:
                                with XmlWrite.Element(myS, 'a',
                                                {'name' : '%d' % theLex.lineNum}):
                                    setItuLineNumbers.add(theLex.lineNum)
                            # Write the line prefix
                            myS.characters(indentStr)
                            myS.characters('[')
                            myS.characters(' ' * \
                                    (LINE_FIELD_WIDTH - len('%d' % theLex.lineNum)))
                            HtmlUtils.writeHtmlFileLink(
                                    myS,
                                    theLex.fileName,
                                    theLex.lineNum,
                                    '%d' % theLex.lineNum,
                                    theClass=None,
                                )
                            myS.characters(']: ')
                            colNum = 1
            linkToIndex(myS, theIdxPath)
    return myTokCntr, setItuLineNumbers
Ejemplo n.º 22
0
def writeTuIndexHtml(theOutDir, theTuPath, theLexer, theFileCountMap,
                     theTokenCntr, hasIncDot, macroHistoryIndexName):
    with XmlWrite.XhtmlStream(
            os.path.join(theOutDir, tuIndexFileName(theTuPath)),
            mustIndent=INDENT_ML,
    ) as myS:
        with XmlWrite.Element(myS, 'head'):
            with XmlWrite.Element(
                    myS, 'link', {
                        'href': TokenCss.TT_CSS_FILE,
                        'type': "text/css",
                        'rel': "stylesheet",
                    }):
                pass
            with XmlWrite.Element(myS, 'title'):
                myS.characters('CPIP Processing of %s' % theTuPath)
        with XmlWrite.Element(myS, 'body'):
            with XmlWrite.Element(myS, 'h1'):
                myS.characters('CPIP Processing of %s' % theTuPath)
            with XmlWrite.Element(myS, 'p'):
                myS.characters("""This has links to individual pages about the
pre-processing of this file.""")
            # ##
            # Translation unit
            # ##
            with XmlWrite.Element(myS, 'h2'):
                myS.characters('1. Source Code')
            _writeParagraphWithBreaks(myS, SOURCE_CODE_INTRO)
            with XmlWrite.Element(myS, 'h3'):  # 'p'):
                myS.characters('The ')
                with XmlWrite.Element(
                        myS, 'a', {
                            'href': HtmlUtils.retHtmlFileName(theTuPath),
                        }):
                    myS.characters('source file')
                myS.characters(' and ')
                with XmlWrite.Element(myS, 'a', {
                        'href': tuFileName(theTuPath),
                }):
                    myS.characters('as a translation unit')
            # ##
            # Include graph
            # ##
            with XmlWrite.Element(myS, 'h2'):
                myS.characters('2. Include Graphs')
            _writeParagraphWithBreaks(myS, INCLUDE_GRAPH_INTRO)
            with XmlWrite.Element(myS, 'h3'):  # 'p'):
                myS.characters('A ')
                with XmlWrite.Element(
                        myS, 'a', {
                            'href': includeGraphFileNameSVG(theTuPath),
                        }):
                    myS.characters('visual #include tree in SVG')
                # If we have successfully written a .dot file then link to it
                if hasIncDot:
                    myS.characters(', ')
                    with XmlWrite.Element(
                            myS, 'a', {
                                'href': includeGraphFileNameDotSVG(theTuPath),
                            }):
                        myS.characters('Dot dependency [SVG]')
                myS.characters(' or ')
                with XmlWrite.Element(
                        myS, 'a', {
                            'href': includeGraphFileNameText(theTuPath),
                        }):
                    myS.characters('as Text')
            # ##
            # Conditional compilation
            # ##
            with XmlWrite.Element(myS, 'h2'):
                myS.characters('3. Conditional Compilation')
            _writeParagraphWithBreaks(myS, CONDITIONAL_COMPILATION_INTRO)
            with XmlWrite.Element(myS, 'h3'):  # 'p'):
                myS.characters('The ')
                with XmlWrite.Element(
                        myS, 'a', {
                            'href': includeGraphFileNameCcg(theTuPath),
                        }):
                    myS.characters('conditional compilation graph')
            # ##
            # Macro history
            # ##
            with XmlWrite.Element(myS, 'h2'):
                myS.characters('4. Macros')
            _writeParagraphWithBreaks(myS, MACROS_INTRO)
            with XmlWrite.Element(myS, 'h3'):
                myS.characters('The ')
                with XmlWrite.Element(myS, 'a', {
                        'href': macroHistoryIndexName,
                }):
                    myS.characters('Macro Environment')
            # ##
            # Write out token counter as a table
            # ##
            with XmlWrite.Element(myS, 'h2'):
                myS.characters('5. Token Count')
            _writeParagraphWithBreaks(myS, TOKEN_COUNT_INTRO)
            with XmlWrite.Element(myS, 'table', {'class': "monospace"}):
                with XmlWrite.Element(myS, 'tr'):
                    with XmlWrite.Element(myS, 'th', {'class': "monospace"}):
                        myS.characters('Token Type')
                    with XmlWrite.Element(myS, 'th', {'class': "monospace"}):
                        myS.characters('Count')
                myTotal = 0
                for tokType, tokCount in theTokenCntr.tokenTypesAndCounts(
                        isAll=True, allPossibleTypes=True):
                    with XmlWrite.Element(myS, 'tr'):
                        with XmlWrite.Element(myS, 'td',
                                              {'class': "monospace"}):
                            myS.characters(tokType)
                        with XmlWrite.Element(myS, 'td',
                                              {'class': "monospace"}):
                            # <tt> does not preserve space so force it to
                            myStr = '%10d' % tokCount
                            myStr = myStr.replace(' ', '&nbsp;')
                            myS.literal(myStr)
                        myTotal += tokCount
                with XmlWrite.Element(myS, 'tr'):
                    with XmlWrite.Element(myS, 'td', {'class': "monospace"}):
                        with XmlWrite.Element(myS, 'b'):
                            myS.characters('Total:')
                    with XmlWrite.Element(myS, 'td', {'class': "monospace"}):
                        with XmlWrite.Element(myS, 'b'):
                            # <tt> does not preserve space so force it to
                            myStr = '%10d' % myTotal
                            myStr = myStr.replace(' ', '&nbsp;')
                            myS.literal(myStr)
            with XmlWrite.Element(myS, 'br'):
                pass
            with XmlWrite.Element(myS, 'h2'):
                myS.characters('6. Files Included and Count')
            _writeParagraphWithBreaks(myS, FILES_INCLUDED_INTRO)
            with XmlWrite.Element(myS, 'p'):
                myS.characters('Total number of unique files: %d' %
                               len(theFileCountMap))
            # TODO: Value count
            # with XmlWrite.Element(myS, 'p'):
            #    myS.characters('Total files processed: %d' % sum(theFileCountMap.values()))
            myItuFileS = sorted(theFileCountMap.keys())
            # Create a list for the DictTree
            myFileLinkS = [
                (
                    p,
                    # Value is a tripple (href, basename, count)
                    (HtmlUtils.retHtmlFileName(p), os.path.basename(p),
                     theFileCountMap[p]),
                ) for p in myItuFileS if p != PpLexer.UNNAMED_FILE_NAME
            ]
            HtmlUtils.writeFilePathsAsTable(None, myS, myFileLinkS,
                                            'filetable', _tdCallback)
            with XmlWrite.Element(myS, 'br'):
                pass
            # TODO...
            with XmlWrite.Element(myS, 'p'):
                myS.characters('Produced by %s version: %s' %
                               ('CPIPMain', __version__))
            # Back link
            with XmlWrite.Element(myS, 'p'):
                myS.characters('Back to: ')
                with XmlWrite.Element(myS, 'a', {
                        'href': 'index.html',
                }):
                    myS.characters('Index Page')
Ejemplo n.º 23
0
def processMacroHistoryToHtml(theLex, theHtmlPath, theItu, theIndexPath):
    """Write out the macro history from the PpLexer as HTML.
    Returns a map of:
    {identifier : [(fileId, lineNum, href_name), ...], ...}
    which can be used by src->html generator for providing links to macro pages."""
    TokenCss.writeCssToDir(os.path.dirname(theHtmlPath))
    # Grab the environment
    myEnv = theLex.macroEnvironment
    # Write the index page that links to the referenced and non-referenced pages
    with XmlWrite.XhtmlStream(
            os.path.join(theHtmlPath, _macroHistoryIndexName(theItu))) as myS:
        with XmlWrite.Element(myS, 'head'):
            with XmlWrite.Element(
                    myS, 'link', {
                        'href': TokenCss.TT_CSS_FILE,
                        'type': "text/css",
                        'rel': "stylesheet",
                    }):
                pass
            with XmlWrite.Element(myS, 'title'):
                myS.characters('Macro Environment for: %s' % theItu)
        with XmlWrite.Element(myS, 'body'):
            with XmlWrite.Element(myS, 'h1'):
                myS.characters('Macro Environment for: %s' % theItu)
            with XmlWrite.Element(myS, 'p'):
                myS.characters(
                    """A page describing the macros encountered during pre-processing, their definition, where defined,
where used and their dependencies. All linked to the source code.""")
            _linkToIndex(myS, theIndexPath)
            # Write the TOC and get the sorted list all the macros in alphabetical order
            _writeTocMacros(myS,
                            myEnv,
                            isReferenced=True,
                            filePrefix=_macroHistoryRefName(theItu))
            _writeTocMacros(myS,
                            myEnv,
                            isReferenced=False,
                            filePrefix=_macroHistoryNorefName(theItu))
            # Write back link
            _linkToIndex(myS, theIndexPath)
    # Write the page for referenced macros
    with XmlWrite.XhtmlStream(
            os.path.join(theHtmlPath, _macroHistoryRefName(theItu))) as myS:
        with XmlWrite.Element(myS, 'head'):
            with XmlWrite.Element(
                    myS, 'link', {
                        'href': TokenCss.TT_CSS_FILE,
                        'type': "text/css",
                        'rel': "stylesheet",
                    }):
                pass
            with XmlWrite.Element(myS, 'title'):
                myS.characters('Referenced Macros for: %s' % theItu)
        with XmlWrite.Element(myS, 'body'):
            with XmlWrite.Element(myS, 'h1'):
                myS.characters('Referenced Macros for: %s' % theItu)
            _linkToIndex(myS, theIndexPath)
            _writeTocMacros(myS, myEnv, isReferenced=True, filePrefix=None)
            _writeSectionOnMacroHistory(myS,
                                        myEnv, [
                                            PpLexer.UNNAMED_FILE_NAME,
                                        ],
                                        theHtmlPath,
                                        theItu,
                                        isReferenced=True)
            _linkToIndex(myS, theIndexPath)
    # Write the page for non-referenced macros
    with XmlWrite.XhtmlStream(
            os.path.join(theHtmlPath, _macroHistoryNorefName(theItu))) as myS:
        with XmlWrite.Element(myS, 'head'):
            with XmlWrite.Element(
                    myS, 'link', {
                        'href': TokenCss.TT_CSS_FILE,
                        'type': "text/css",
                        'rel': "stylesheet",
                    }):
                pass
            with XmlWrite.Element(myS, 'title'):
                myS.characters('Non-Referenced Macros for: %s' % theItu)
        with XmlWrite.Element(myS, 'body'):
            with XmlWrite.Element(myS, 'h1'):
                myS.characters('Non-Referenced Macros for: %s' % theItu)
            _linkToIndex(myS, theIndexPath)
            _writeTocMacros(myS, myEnv, isReferenced=False, filePrefix=None)
            _writeSectionOnMacroHistory(myS,
                                        myEnv, [
                                            PpLexer.UNNAMED_FILE_NAME,
                                        ],
                                        theHtmlPath,
                                        theItu,
                                        isReferenced=False)
            _linkToIndex(myS, theIndexPath)
    retVal = _retMacroIdHrefNames(myEnv, theItu)
    #     print('retVal', retVal)
    #     print('indexPath', indexPath)
    return retVal, _macroHistoryIndexName(theItu)
Ejemplo n.º 24
0
    def test_02(self):
        """Test_writeFilePathsAsTable.test_01(): writeFilePathsAsTable() - With header"""
        myF = io.StringIO()
        myFileNameValueS = [
            # filename, (href, navText, file_data) where file data is count_inc, count_lines, count_bytes
            ('spam/chips.lis', ('chips.html', 'Chips', (1, 2, 3))),
            ('spam/eggs.lis', ('eggs.html', 'Eggs', (10, 11, 12))),
            ('spam/fishfingers/beans.lis', ('fishfingers/beans.html', 'Beans',
                                            (100, 101, 102))),
            ('spam/fishfingers/peas.lis', ('fishfingers/peas.html', 'Peas',
                                           (1000, 1001, 1002))),
        ]

        def _tdCallback(theS, attrs, _k, href_nav_text_file_data):
            """Callback function for the file count table. This comes from CPIPMain.py"""
            attrs['class'] = 'filetable'
            href, navText, file_data = href_nav_text_file_data
            with XmlWrite.Element(theS, 'td', attrs):
                with XmlWrite.Element(theS, 'a', {'href': href}):
                    # Write the nav text
                    theS.characters(navText)
            td_attrs = {
                'width': "36px",
                'class': 'filetable',
                'align': "right",
            }
            count_inc, count_lines, count_bytes = file_data
            with XmlWrite.Element(theS, 'td', td_attrs):
                # Write the file count of inclusions
                theS.characters('%d' % count_inc)
            with XmlWrite.Element(theS, 'td', td_attrs):
                # Write the file count of lines
                theS.characters('{:,d}'.format(count_lines))
            with XmlWrite.Element(theS, 'td', td_attrs):
                # Write the file count of bytes
                theS.characters('{:,d}'.format(count_bytes))
            with XmlWrite.Element(theS, 'td', td_attrs):
                # Write the file count of lines * inclusions
                theS.characters('{:,d}'.format(count_lines * count_inc))
            with XmlWrite.Element(theS, 'td', td_attrs):
                # Write the file count of bytes * inclusions
                theS.characters('{:,d}'.format(count_bytes * count_inc))

        def _trThCallback(theS, theDepth):
            """This comes from CPIPMain.py. Create the table header:
              <tr>
                <th class="filetable" colspan="9">File Path&nbsp;</th>
                <th class="filetable">Include Count</th>
                <th class="filetable">Lines</th>
                <th class="filetable">Bytes</th>
                <th class="filetable">Total Lines</th>
                <th class="filetable">Total Bytes</th>
              </tr>
            """
            with XmlWrite.Element(theS, 'tr', {}):
                with XmlWrite.Element(theS, 'th', {
                        'colspan': '%d' % theDepth,
                        'class': 'filetable',
                }):
                    theS.characters('File Path')
                with XmlWrite.Element(theS, 'th', {'class': 'filetable'}):
                    theS.characters('Include Count')
                with XmlWrite.Element(theS, 'th', {'class': 'filetable'}):
                    theS.characters('Lines')
                with XmlWrite.Element(theS, 'th', {'class': 'filetable'}):
                    theS.characters('Bytes')
                with XmlWrite.Element(theS, 'th', {'class': 'filetable'}):
                    theS.characters('Total Lines')
                with XmlWrite.Element(theS, 'th', {'class': 'filetable'}):
                    theS.characters('Total Bytes')

        with XmlWrite.XhtmlStream(myF) as myS:
            HtmlUtils.writeFilePathsAsTable(None,
                                            myS,
                                            myFileNameValueS,
                                            'table_style',
                                            fnTd=_tdCallback,
                                            fnTrTh=_trThCallback)
        # print()
        # print(myF.getvalue())
        # self.maxDiff = None
        # print(myFileLinkS)
        self.assertEqual(
            myF.getvalue(), """<?xml version='1.0' encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <table class="table_style">
    <tr>
      <th class="filetable" colspan="3">File Path</th>
      <th class="filetable">Include Count</th>
      <th class="filetable">Lines</th>
      <th class="filetable">Bytes</th>
      <th class="filetable">Total Lines</th>
      <th class="filetable">Total Bytes</th>
    </tr>
    <tr>
      <td class="table_style" rowspan="4">spam/</td>
      <td class="filetable" colspan="2">
        <a href="chips.html">Chips</a>
      </td>
      <td align="right" class="filetable" width="36px">1</td>
      <td align="right" class="filetable" width="36px">2</td>
      <td align="right" class="filetable" width="36px">3</td>
      <td align="right" class="filetable" width="36px">2</td>
      <td align="right" class="filetable" width="36px">3</td>
    </tr>
    <tr>
      <td class="filetable" colspan="2">
        <a href="eggs.html">Eggs</a>
      </td>
      <td align="right" class="filetable" width="36px">10</td>
      <td align="right" class="filetable" width="36px">11</td>
      <td align="right" class="filetable" width="36px">12</td>
      <td align="right" class="filetable" width="36px">110</td>
      <td align="right" class="filetable" width="36px">120</td>
    </tr>
    <tr>
      <td class="table_style" rowspan="2">fishfingers/</td>
      <td class="filetable">
        <a href="fishfingers/beans.html">Beans</a>
      </td>
      <td align="right" class="filetable" width="36px">100</td>
      <td align="right" class="filetable" width="36px">101</td>
      <td align="right" class="filetable" width="36px">102</td>
      <td align="right" class="filetable" width="36px">10,100</td>
      <td align="right" class="filetable" width="36px">10,200</td>
    </tr>
    <tr>
      <td class="filetable">
        <a href="fishfingers/peas.html">Peas</a>
      </td>
      <td align="right" class="filetable" width="36px">1000</td>
      <td align="right" class="filetable" width="36px">1,001</td>
      <td align="right" class="filetable" width="36px">1,002</td>
      <td align="right" class="filetable" width="36px">1,001,000</td>
      <td align="right" class="filetable" width="36px">1,002,000</td>
    </tr>
  </table>
</html>
""")