Example #1
0
    def doc(self, trans, breadcrumbs):
        self.out = trans.get_response_stream()

        breadcrumbs = None

        docSubstitute = self.handleDocSubstitute if hasattr(
            self,
            "handleDocSubstitute") else u"No further documentation available."

        trans.set_response_code(200)
        trans.set_content_type(ContentType("text/html", "utf-8"))
        print >> self.out, (
            u"""<html>
    <head>
        <title>{0}{1}{2}</title>
    </head>
    <body>
        <h1>Documentation</h1>""" + (u"""
        <div class="doc-breadcrumbs">{3}</div>"""
                                     if breadcrumbs is not None else u"") +
            u"""
        <h2>{0}</h2>
        <p>{4}</p>
        {5}
    </body>
</html>""").format(
                self.title,
                (misc.get("titleSeparator", u" ") + application["name"] +
                 u" documentation") if "name" in application else u"",
                (misc.get("titleSeparator", u" ") +
                 application["host"]) if "host" in application else u"", u"",
                self.shortDescription
                if hasattr(self, "shortDescription") else u"",
                self.handleDoc() or docSubstitute if hasattr(
                    self, "handleDoc") else docSubstitute).encode("utf-8")
Example #2
0
 def formatHTMLTitle(self, pageTitle, appNameSuffix=u""):
     return u"""{0}{1}{2}""".format(
         pageTitle,
         (misc.get("titleSeparator", u" ") + application["name"] +
          appNameSuffix) if "name" in application else u"",
         (misc.get("titleSeparator", u" ") +
          application["host"]) if "host" in application else u"")
Example #3
0
    def doc(self, trans, breadcrumbs):
        self.out = trans.get_response_stream()
        
        breadcrumbs = None
        
        docSubstitute = self.handleDocSubstitute if hasattr(self, "handleDocSubstitute") else u"No further documentation available."
        
        trans.set_response_code(200)
        trans.set_content_type(ContentType("text/html", "utf-8"))
        print >>self.out, (u"""<html>
    <head>
        <title>{0}{1}{2}</title>
    </head>
    <body>
        <h1>Documentation</h1>"""+(u"""
        <div class="doc-breadcrumbs">{3}</div>""" if breadcrumbs is not None else u"")+u"""
        <h2>{0}</h2>
        <p>{4}</p>
        {5}
    </body>
</html>""").format(
            self.title,
            (misc.get("titleSeparator", u" ") + application["name"] + u" documentation") if "name" in application else u"",
            (misc.get("titleSeparator", u" ") + application["host"]) if "host" in application else u"",
            u"",
            self.shortDescription if hasattr(self, "shortDescription") else u"",
            self.handleDoc() or docSubstitute if hasattr(self, "handleDoc") else docSubstitute
        ).encode("utf-8")
Example #4
0
    def listing(self, trans):
        self.out = trans.get_response_stream()
        trans.set_response_code(200)
        trans.set_content_type(ContentType("text/html", "utf-8"))
        print >>self.out, u"""<html>
    <head>
        <title>{0}{1}{2}</title>
    </head>
    <body>
        <h1>Index of {0}</h1>
        <ul>
            {3}
        </ul>
    </body>
</html>""".format(
            self.title,
            (misc.get("titleSeparator", u" ") + application["name"]) if "name" in application else u"",
            (misc.get("titleSeparator", u" ") + application["host"]) if "host" in application else u"",
            self.formatListing()
        ).encode("utf-8")
Example #5
0
    def listing(self, trans):
        self.out = trans.get_response_stream()
        trans.set_response_code(200)
        trans.set_content_type(ContentType("text/html", "utf-8"))
        print >> self.out, u"""<html>
    <head>
        <title>{0}{1}{2}</title>
    </head>
    <body>
        <h1>Index of {0}</h1>
        <ul>
            {3}
        </ul>
    </body>
</html>""".format(self.title,
                  (misc.get("titleSeparator", u" ") +
                   application["name"]) if "name" in application else u"",
                  (misc.get("titleSeparator", u" ") +
                   application["host"]) if "host" in application else u"",
                  self.formatListing()).encode("utf-8")
Example #6
0
    def docListing(self, trans, breadcrumbs):
        self.out = trans.get_response_stream()
        trans.set_response_code(200)
        trans.set_content_type(ContentType("text/html", "utf-8"))
        print >>self.out, (u"""<html>
    <head>
        <title>{0}{1}{2}</title>
    </head>
    <body>
        <h1>Documentation</h1>"""+(u"""
        <div class="doc-breadcrumbs">{3}</div>""" if breadcrumbs is not None else u"")+u"""
        <h2>{0}</h2>
        <ul>
            {4}
        </ul>
    </body>
</html>""").format(
            self.title,
            (misc.get("titleSeparator", u" ") + application["name"] + u" documentation") if "name" in application else u"",
            (misc.get("titleSeparator", u" ") + application["host"]) if "host" in application else u"",
            u"",
            self.formatListing()
        ).encode("utf-8")
Example #7
0
    def docListing(self, trans, breadcrumbs):
        self.out = trans.get_response_stream()
        trans.set_response_code(200)
        trans.set_content_type(ContentType("text/html", "utf-8"))
        print >> self.out, (u"""<html>
    <head>
        <title>{0}{1}{2}</title>
    </head>
    <body>
        <h1>Documentation</h1>""" + (u"""
        <div class="doc-breadcrumbs">{3}</div>""" if breadcrumbs is not None
                                     else u"") + u"""
        <h2>{0}</h2>
        <ul>
            {4}
        </ul>
    </body>
</html>""").format(self.title,
                   (misc.get("titleSeparator", u" ") + application["name"] +
                    u" documentation") if "name" in application else u"",
                   (misc.get("titleSeparator", u" ") +
                    application["host"]) if "host" in application else u"",
                   u"", self.formatListing()).encode("utf-8")
Example #8
0
 def setTitle(self, title):
     self.title.text = u"{0}{1}{2}".format(
         title, (misc.get("titleSeparator", u" ") +
                 application["name"]) if "name" in application else u"",
         (misc.get("titleSeparator", u" ") +
          application["host"]) if "host" in application else u"")
Example #9
0
 def setTitle(self, title):
     self.title.text = u"{0}{1}{2}".format(
         title,
         (misc.get("titleSeparator", u" ") + application["name"]) if "name" in application else u"",
         (misc.get("titleSeparator", u" ") + application["host"]) if "host" in application else u""
     )
Example #10
0
 def formatHTMLTitle(self, pageTitle, appNameSuffix = u""):
     return u"""{0}{1}{2}""".format(
         pageTitle,
         (misc.get("titleSeparator", u" ") + application["name"] + appNameSuffix) if "name" in application else u"",
         (misc.get("titleSeparator", u" ") + application["host"]) if "host" in application else u""
     )