Source

pypy / pypy / doc / confrest.py

holger krekel 10bdfb0 
holger krekel 293639c 

Armin Rigo 4ac21ef 
holger krekel 293639c 
holger krekel bb0faaf 
Alex Gaynor 5457ef9 

holger krekel 3bef9bd 










Alex Gaynor 5457ef9 
holger krekel 10bdfb0 

Alex Gaynor 5457ef9 


holger krekel fdad3e0 
Maciej Fijalkows… 9775ea2 
Alex Gaynor 5457ef9 
Guido Wesdorp 0ffd49e 

Alex Gaynor 5457ef9 
holger krekel fdad3e0 
Armin Rigo 4ac21ef 
holger krekel fdad3e0 
Alex Gaynor 5457ef9 
Armin Rigo e4cca2f 
holger krekel fdad3e0 
Alex Gaynor 5457ef9 
Guido Wesdorp 0ffd49e 
Alex Gaynor 5457ef9 
Guido Wesdorp 0ffd49e 
holger krekel bb0faaf 

Guido Wesdorp 0ffd49e 

holger krekel 293639c 
holger krekel 3bef9bd 
Alex Gaynor 5457ef9 

holger krekel 3bef9bd 
Alex Gaynor 5457ef9 



Guido Wesdorp 0ffd49e 
Alex Gaynor 5457ef9 

holger krekel 9268676 
holger krekel 10bdfb0 
Alex Gaynor 5457ef9 
holger krekel bb0faaf 
Alex Gaynor 5457ef9 
holger krekel bb0faaf 


Alex Gaynor 5457ef9 

holger krekel bb0faaf 
Alex Gaynor 5457ef9 
import py

# XXX importing/inheriting from an internal py lib class is hackish
from confrest_oldpy import Project, Page, relpath
html = py.xml.html


class PyPyPage(Page):
    googlefragment = """
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7778406-2");
pageTracker._trackPageview();
} catch(err) {}</script>
"""

    def fill_menubar(self):
        self.menubar = html.div(
            html.a("home",
                   href=self.get_doclink("index.html"),
                   class_="menu"),
            " ",
            html.a("blog", href="http://morepypy.blogspot.com", class_="menu"),
            " ",
            html.a("getting-started",
                   href=self.get_doclink("getting-started.html"),
                   class_="menu"),
            " ",
            html.a("documentation", href=self.get_doclink("docindex.html"),
                   class_="menu"),
            " ",
            html.a("hg", href="https://bitbucket.org/pypy/pypy",
                   class_="menu"),
            " ",
            html.a("issues",
                   href="https://bugs.pypy.org/",
                   class_="menu"),
            " ", id="menubar")

    def get_doclink(self, target):
        return relpath(self.targetpath.strpath,
                       self.project.docpath.join(target).strpath)

    def unicode(self, doctype=True):
        page = self._root.unicode()
        page = page.replace("</body>", self.googlefragment + "</body>")
        if doctype:
            return self.doctype + page
        else:
            return page


class Project(Project):
    mydir = py.path.local(__file__).dirpath()

    title = "PyPy"
    stylesheet = 'style.css'
    encoding = 'latin1'
    prefix_title = "PyPy"
    logo = html.div(
        html.a(
            html.img(alt="PyPy", id="pyimg",
                     src="http://codespeak.net/pypy/img/py-web1.png",
                     height=110, width=149)))
    Page = PyPyPage