[tor-commits] [bridgedb/master] Add docstrings to HTTPServer.WebRoot class and render_GET() method.

isis at torproject.org isis at torproject.org
Tue Feb 4 00:28:47 UTC 2014


commit 0f2f138f16e98110ee723cf9845b49dc52345482
Author: Isis Lovecruft <isis at torproject.org>
Date:   Fri Jan 24 03:37:45 2014 +0000

    Add docstrings to HTTPServer.WebRoot class and render_GET() method.
---
 lib/bridgedb/HTTPServer.py |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/lib/bridgedb/HTTPServer.py b/lib/bridgedb/HTTPServer.py
index be5bc44..153918b 100644
--- a/lib/bridgedb/HTTPServer.py
+++ b/lib/bridgedb/HTTPServer.py
@@ -292,11 +292,23 @@ class WebResource(twisted.web.resource.Resource):
                                                               rtl=rtl)
 
 class WebRoot(twisted.web.resource.Resource):
+    """The parent resource of all other documents hosted by the webserver."""
+
     isLeaf = True
+
     def render_GET(self, request):
+        """Handles requests for the webserver root document.
+
+        For example, this function handles requests for
+        https://bridges.torproject.org/.
+
+        :type request: :api:`twisted.web.server.Request`
+        :param request: An incoming request.
+        """
         rtl = usingRTLLang(request)
         return lookup.get_template('index.html').render(rtl=rtl)
 
+
 def addWebServer(cfg, dist, sched):
     """Set up a web server.
          cfg -- a configuration object from Main.  We use these options:





More information about the tor-commits mailing list