def __init__(self, file, rootdir, relthis): self.__body = None root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, 'Barry A. Warsaw', '*****@*****.**') f = self.__linkfixer = LinkFixer(html, rootdir, relthis) p.process_sidebar() p.sidebar.append(BLANKCELL) # massage our links self.__d = {'rootdir': rootdir} self.__linkfixer.massage(p.sidebar, self.__d) # tweak p.sidebar.append(('http://www.python.org/', ''' <center> <img border="0" src="%(rootdir)s/images/PythonPoweredSmall.gif"></center>''' % self.__d)) p.sidebar.append(BLANKCELL) copyright = self.__parser.get('copyright', '1996-%d' % time.localtime()[0]) p.sidebar.append((None, '© ' + copyright)) p.sidebar.append((None, 'Barry A. Warsaw')) Sidebar.__init__(self, p.sidebar) # # fix up our site links, no relthis because the site links are # relative to the root of my web pages # sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self.__d, aboves=1) Banner.__init__(self, sitelinks, cols=2) # kludge! for i in range(len(p.sidebar)-1, -1, -1): if p.sidebar[i] == 'Email Us': p.sidebar[i] = 'Email me' break
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, self.AUTHOR) f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # calculate the sidebar links, adding a few of our own self.__d = {'rootdir': rootdir} p.process_sidebar() p.sidebar.append(BLANKCELL) # it is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up p.sidebar.append(('%(rootdir)s', ''' <center> <img alt="" border=0 src="%(rootdir)s/pics/PythonPoweredSmall.gif"></center> ''' % self.__d)) self.__linkfixer.massage(p.sidebar, self.__d) Sidebar.__init__(self, p.sidebar) # # fix up our site links, no relthis because the site links are # relative to the root of our web pages # sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self.__d, aboves=1) Banner.__init__(self, sitelinks) # calculate the random corner # XXX Should really do a list of the pics directory... NBANNERS = 64 i = whrandom.randint(0, NBANNERS-1) s = "PyBanner%03d.gif" % i self.__d['banner'] = s self.__whichbanner = i
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, self.AUTHOR) f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # calculate the sidebar links, adding a few of our own self.__d = {'rootdir': rootdir} p.process_sidebar() p.sidebar.append(BLANKCELL) # it is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up p.sidebar.append(('http://sourceforge.net/projects/spambayes', ''' <div align="right"> <img alt="" border="0" src="http://sourceforge.net/sflogo.php?group_id=61702&type=1"></div> ''')) self.__linkfixer.massage(p.sidebar, self.__d) SpamBayesSidebar.__init__(self, p.sidebar) # # fix up our site links, no relthis because the site links are # relative to the root of our web pages # sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self.__d, aboves=1) Banner.__init__(self, sitelinks)
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, '*****@*****.**') f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # calculate the sidebar links, adding a few of our own self._d = {'rootdir': rootdir} p.process_sidebar() p.sidebar.append(BLANKCELL) # it is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up p.sidebar.append(('http://www.python.org/', ''' <center> <img border=0 src="%(rootdir)s/images/PythonPoweredSmall.gif"></center> ''' % self._d)) self.__linkfixer.massage(p.sidebar, self._d) Sidebar.__init__(self, p.sidebar) # # fix up our site links, no relthis because the site links are # relative to the root of our web pages # sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self._d, aboves=1) Banner.__init__(self, sitelinks, cols=2)
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, '*****@*****.**') f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # calculate the sidebar links, adding a few of our own self._d = {'rootdir': rootdir} p.process_sidebar() p.sidebar.append(BLANKCELL) # it is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up p.sidebar.append(('http://www.python.org/', ''' <center> <img border="0" src="%(rootdir)s/images/PythonPoweredSmall.gif"></center> ''' % self._d)) self.__linkfixer.massage(p.sidebar, self._d) Sidebar.__init__(self, p.sidebar) # # fix up our site links, no relthis because the site links are # relative to the root of our web pages # sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self._d, aboves=1) Banner.__init__(self, sitelinks, cols=2)
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, self.AUTHOR) f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # calculate the sidebar links, adding a few of our own self.__d = {'rootdir': rootdir} p.process_sidebar() p.sidebar.append(BLANKCELL) # it is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up p.sidebar.append(('%(rootdir)s', ''' <center> <img alt="" border="0" src="%(rootdir)s/pics/PythonPoweredSmall.gif"></center> ''' % self.__d)) self.__linkfixer.massage(p.sidebar, self.__d) Sidebar.__init__(self, p.sidebar) # # fix up our site links, no relthis because the site links are # relative to the root of our web pages # sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self.__d, aboves=1) Banner.__init__(self, sitelinks) # calculate the random corner # XXX Should really do a list of the pics directory... NBANNERS = 64 i = whrandom.randint(0, NBANNERS - 1) s = "PyBanner%03d.gif" % i self.__d['banner'] = s self.__whichbanner = i
class StandardGenerator(Skeleton, Sidebar): def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self._parser = HTParser(file) self._linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None p.process_sidebar() self._linkfixer.massage(p.sidebar) Sidebar.__init__(self, p.sidebar) def get_title(self): return self._parser.get('title') def get_sidebar(self): return Sidebar.get_sidebar(self) def get_banner(self): return None def get_corner(self): return None def get_body(self): if self.__body is None: self.__body = self._parser.fp.read() return self.__body
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, self.AUTHOR, self.EMAIL) f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # Calculate the sidebar links, adding a few of our own. self.__d = {'rootdir': rootdir} dir = os.path.split(file)[0] p.process_sidebar() p.sidebar.append(BLANKCELL) # It is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up. self.__linkfixer.massage(p.sidebar, self.__d) Sidebar.__init__(self, p.sidebar) p.sidebar.append(BLANKCELL) # Fix up our site links, no relthis because the site links are # relative to the root of our web pages. sitelinks=get_sitelinks(file, rootdir, relthis) sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self.__d, aboves=1) Banner.__init__(self, sitelinks) # kludge! for i in range(len(p.sidebar)-1, -1, -1): if p.sidebar[i] == 'Email Us': p.sidebar[i] = 'Email me' break p.sidebar.append((None, ''))
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, 'x@y') f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # calculate the sidebar links, adding a few of our own self._d = {'rootdir': rootdir} p.process_sidebar() # remove "Email us" and use replacement del p.sidebar[-2:] p.sidebar.append('Contact') p.sidebar.append( ('http://lists.sourceforge.net/lists/listinfo/jython-users', 'Questions on Jython?<br>jython-users')) p.sidebar.append(BLANKCELL) # it is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up p.sidebar.append(('http://www.python.org/', ''' <center> <img border="0" src="%(rootdir)s/images/PythonPoweredSmall.gif"></center> ''' % self._d)) p.sidebar.append(BLANKCELL) p.sidebar.append(('http://sourceforge.net/', ''' <center> <img src="http://sourceforge.net/sflogo.php?group_id=12867" width="88" height="31" border="0" alt="SourceForge Logo"></center> ''' % self._d)) if self.webmaster: # webmaster -> jython-dev p.sidebar.append(BLANKCELL) p.sidebar.append(BLANKCELL) p.sidebar.append(('mailto:[email protected]', 'webmaster')) self.__linkfixer.massage(p.sidebar, self._d) Sidebar.__init__(self, p.sidebar) # # fix up our site links, no relthis because the site links are # relative to the root of our web pages # sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(self.sitelinks, self._d, aboves=1) Banner.__init__(self, self.sitelinks, cols=2)
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file,'x@y') f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # calculate the sidebar links, adding a few of our own self._d = {'rootdir': rootdir} p.process_sidebar() # remove "Email us" and use replacement del p.sidebar[-2:] p.sidebar.append('Contact') p.sidebar.append(('http://lists.sourceforge.net/lists/listinfo/jython-users','Questions on Jython?<br>jython-users')) p.sidebar.append(BLANKCELL) # it is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up p.sidebar.append(('http://www.python.org/', ''' <center> <img border="0" src="%(rootdir)s/images/PythonPoweredSmall.gif"></center> ''' % self._d)) p.sidebar.append(BLANKCELL) p.sidebar.append(('http://sourceforge.net/', ''' <center> <img src="http://sourceforge.net/sflogo.php?group_id=12867" width="88" height="31" border="0" alt="SourceForge Logo"></center> ''' % self._d)) if self.webmaster: # webmaster -> jython-dev p.sidebar.append(BLANKCELL) p.sidebar.append(BLANKCELL) p.sidebar.append(('mailto:[email protected]','webmaster')) self.__linkfixer.massage(p.sidebar, self._d) Sidebar.__init__(self, p.sidebar) # # fix up our site links, no relthis because the site links are # relative to the root of our web pages # sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(self.sitelinks, self._d, aboves=1) Banner.__init__(self, self.sitelinks, cols=2)
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, self.AUTHOR, self.EMAIL) f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # Calculate the sidebar links, adding a few of our own. self.__d = {'rootdir': rootdir} p.process_sidebar() p.sidebar.append(BLANKCELL) # It is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up. p.sidebar.append(('http://www.python.org/', '''\ <img class="side" alt="[Python Powered]" border="0" src="img/PythonPoweredSmall.png">''' % self.__d)) self.__linkfixer.massage(p.sidebar, self.__d) Sidebar.__init__(self, p.sidebar) copyright = self.__parser.get('copyright', '1999-%d' % time.localtime()[0]) p.sidebar.append((None, '© ' + copyright)) p.sidebar.append(('http://www.python.org/psf/', 'Python Software Foundation')) p.sidebar.append((None, '<hr>')) p.sidebar.append((None, '''<script type="text/javascript" \ src="http://www.altervista.org/js_tags/contatore.js"> </script> ''')) p.sidebar.append((None, '''last update''')) p.sidebar.append((None, time.asctime())) # Fix up our site links, no relthis because the site links are # relative to the root of our web pages. sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self.__d, aboves=1) Banner.__init__(self, sitelinks) # kludge! for i in range(len(p.sidebar)-1, -1, -1): if p.sidebar[i] == 'Email Us': p.sidebar[i] = 'Email me' break
def __init__(self, file, rootdir, relthis): self.__body = None root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, '*****@*****.**') f = self.__linkfixer = LinkFixer(html, rootdir, relthis) p.process_sidebar() p.sidebar.append(BLANKCELL) # massage our links self.__d = {'rootdir': rootdir} self.__linkfixer.massage(p.sidebar, self.__d) # tweak p.sidebar.append((None, """\ <center><a href="http://www.python.org/"><img border=0 src="%(rootdir)s/images/PythonPoweredSmall.png"></a> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=103" width="88" height="31" border="0" alt="SourceForge Logo"></a> """ % self.__d)) p.sidebar.append(BLANKCELL) years = COMMA.join([str(x) for x in range(1998, time.localtime()[0]+1)]) copyright = self.__parser.get('copyright', years) p.sidebar.append((None, '© ' + copyright + """\ <br>Free Software Foundation, Inc.<br> Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.<br> Please send comments on these pages to <a href="mailto:[email protected]"> <[email protected]></a>, other questions to <a href="mailto:[email protected]"><[email protected]></a>. """)) Sidebar.__init__(self, p.sidebar) # # fix up our site links, no relthis because the site links are # relative to the root of my web pages # sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self.__d, aboves=1) Banner.__init__(self, sitelinks, cols=3)
def __init__(self, file, rootdir, relthis): root, ext = os.path.splitext(file) html = root + '.html' p = self.__parser = HTParser(file, self.AUTHOR, self.EMAIL) f = self.__linkfixer = LinkFixer(html, rootdir, relthis) self.__body = None self.__cont = None # Calculate the sidebar links, adding a few of our own. self.__d = {'rootdir': rootdir} p.process_sidebar() p.sidebar.append(BLANKCELL) # It is important not to have newlines between the img tag and the end # end center tags, otherwise layout gets messed up. p.sidebar.append(('http://www.python.org/', ''' <center> <img alt="[Python Powered]" border="0" src="PythonPoweredSmall.png"></center> ''' % self.__d)) self.__linkfixer.massage(p.sidebar, self.__d) Sidebar.__init__(self, p.sidebar) p.sidebar.append(BLANKCELL) copyright = self.__parser.get('copyright', '1999-%d' % time.localtime()[0]) p.sidebar.append((None, '© ' + copyright)) p.sidebar.append(('http://www.python.org/psf/', 'Python Software Foundation')) p.sidebar.append((None, '<hr>')) p.sidebar.append((file, '[page source]')) # Fix up our site links, no relthis because the site links are # relative to the root of our web pages. sitelink_fixer = LinkFixer(f.myurl(), rootdir) sitelink_fixer.massage(sitelinks, self.__d, aboves=1) Banner.__init__(self, sitelinks) # kludge! for i in range(len(p.sidebar)-1, -1, -1): if p.sidebar[i] == 'Email Us': p.sidebar[i] = 'Email me' break