示例#1
0
 def convertFile(self, inname, outname=None):
     if outname == None:
         outname = inname + '.html'
     result = self.convertString(open(inname, "r").read())
     htmlstream = html.HTMLFile(outname, inname, bgcolor="FFFFFF")
     htmlstream.pushTag('pre')
     htmlstream.write(result)
     htmlstream.close()
示例#2
0
 def genOverview(self, targetFS, docHeader, dirDescription, memberdocs,
                 updatedDocs):
     dirInfo = Info(str(self.file), dirDescription.info)
     mappedFile = self.file.mapTo(targetFS)
     docDir = self.dir.mapTo(targetFS)
     htmlfile = docDir.join(self.name() + '.html')
     title = dirInfo.title
     release = self.acquire('release')
     targetFS.require(htmlfile.name)
     htmlstream = html.HTMLFile(htmlfile.shellName(),
                                release + ': ' + title,
                                bgcolor=self.acquire('bgcolor', '#FFFFFF'))
     # write header
     htmlstream.write(docHeader.packageHeader(htmlfile))
     htmlstream.titleHeader(title + ' - ' + release)
     htmlstream.pushTag('Blockquote')
     # write description
     if dirInfo.abstract:
         htmlstream.write(html.paragraph(dirInfo.abstract))
     if dirInfo.description:
         htmlstream.write(html.paragraph(dirInfo.description))
     self.insertInfo(str(htmlfile), dirInfo)
     # write links to members
     documents = self.extractDocuments(dirDescription, docDir)
     packages = self.extractPackages(memberdocs)
     sources = self.extractSources(memberdocs)
     tests = self.extractTests(targetFS)
     # updated = self.extractUpdated (memberdocs)
     for title, memberList in [('Documents', documents),
                               ('Packages', packages),
                               ('Headerfiles', sources), ('Tests', tests)]:
         if memberList:
             self.writeTable(htmlstream, docDir, title, memberList)
             htmlstream.lineBreak()
     # self.writeTestDirectory (htmlstream)
     if updatedDocs:
         self.writeTable(htmlstream, docDir, 'Updated', updatedDocs)
         htmlstream.lineBreak()
     # close file
     htmlstream.line()
     genDate(htmlstream)
     htmlstream.close()
     if dirInfo.abstract:
         abstract = dirInfo.abstract
     else:
         abstract = None
     return DocInfo(self.name(), htmlfile, abstract, 'true', 0)
示例#3
0
    def genHTML(self, outfile, tuples):
        title = 'Stundenplan'
        # open file
        stream = html.HTMLFile(outfile,
                               title,
                               background="/Images/backgrounds/sqlback.gif",
                               bgcolor="#ffffff")
        stream.titleHeader(title)
        # open table
        stream.pushTag('table', border=2, cellpadding=5, align='center')
        # gen table header
        stream.write("""
    <TR>
        <TH>Zeit</TH>
        <TH>Tag</TH>
        <TH>Release</TH>
        <TH>Script</TH>
        <TH>Server</TH>
    </TR>
""")
        # gen rows
        rowfmt = """
    <TR>
        <TD>%s</TD>
        <TD>%s</TD>
        <TD>%s</TD>
        <TD>%s</TD>
        <TD>%s</TD>
    </TR>
"""
        for t in tuples:
            stream.write(rowfmt % t)
        # close table
        stream.popTag()
        # write gen data
        stream.line()
        stream.write(
            time.strftime('Generated %d.%m.%Y', time.localtime(time.time())))
        # close stream
        stream.close()
示例#4
0
 def genOverview (self, sourceFS, targetFS, memberdocs):
     # get package description
     contentsFile = sourceFS.search ('Contents.txt')
     if contentsFile:
         description = self.parseContentsFile (sourceFS.absolute (contentsFile))
     else:
         description = ''
     # todo: get old descriptions
     #     merge and save
     #     set new and updated
     # open html stream
     htmlfile = self.name + '.html'
     title = 'Package ' + self.name
     htmlstream = html.HTMLFile (targetFS.absolute (htmlfile), title)
     # write header
     htmlstream.titleHeader (title)
     htmlstream.pushTag ('Blockquote')
     # write description
     if description:
         htmlstream.write (description)
     # write links to members
     htmlstream.pushTag ('DL')
     htmlstream.pseudoBreak ()
     for name, file, memberDesc in memberdocs:
         # write link
         htmlstream.tag ('DT')
         htmlstream.write (html.href (file, name) + '\n')
         # write description
         if memberDesc:
             htmlstream.tag ('DD')
             htmlstream.write (memberDesc)
     htmlstream.popTag ()
     # close file
     htmlstream.line ()
     genDate (htmlstream)
     htmlstream.close ()
     return (self.name, htmlfile, description)
示例#5
0
 def openFile(self, module):
     title = self.getTitle(module)
     attributes = self.getAttributes(module)
     self.htmlstream = html.HTMLFile(self.fname, title, attributes)