2222
2323class ServerHTMLDoc (pydoc .HTMLDoc ):
2424 """Class used to generate pydoc HTML document for a server"""
25-
25+
2626 def markup (self , text , escape = None , funcs = {}, classes = {}, methods = {}):
2727 """Mark up some plain text, given a context of symbols to look for.
2828 Each context dictionary maps object names to anchor names."""
@@ -63,7 +63,7 @@ def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
6363 here = end
6464 results .append (escape (text [here :]))
6565 return '' .join (results )
66-
66+
6767 def docroutine (self , object , name = None , mod = None ,
6868 funcs = {}, classes = {}, methods = {}, cl = None ):
6969 """Produce HTML documentation for a function or method object."""
@@ -72,7 +72,7 @@ def docroutine(self, object, name=None, mod=None,
7272 note = ''
7373
7474 title = '<a name="%s"><strong>%s</strong></a>' % (anchor , name )
75-
75+
7676 if inspect .ismethod (object ):
7777 args , varargs , varkw , defaults = inspect .getargspec (object .im_func )
7878 # exclude the argument bound to the instance, it will be
@@ -96,7 +96,7 @@ def docroutine(self, object, name=None, mod=None,
9696 docstring = object [1 ] or ""
9797 else :
9898 docstring = pydoc .getdoc (object )
99-
99+
100100 decl = title + argspec + (note and self .grey (
101101 '<font face="helvetica, arial">%s</font>' % note ))
102102
@@ -112,10 +112,10 @@ def docserver(self, server_name, package_documentation, methods):
112112 for key , value in methods .items ():
113113 fdict [key ] = '#-' + key
114114 fdict [value ] = fdict [key ]
115-
116- head = '<big><big><strong>%s</strong></big></big>' % server_name
115+
116+ head = '<big><big><strong>%s</strong></big></big>' % server_name
117117 result = self .heading (head , '#ffffff' , '#7799ee' )
118-
118+
119119 doc = self .markup (package_documentation , self .preformat , fdict )
120120 doc = doc and '<tt>%s</tt>' % doc
121121 result = result + '<p>%s</p>\n ' % doc
@@ -136,7 +136,7 @@ class XMLRPCDocGenerator:
136136 This class is designed as mix-in and should not
137137 be constructed directly.
138138 """
139-
139+
140140 def __init__ (self ):
141141 # setup variables used for HTML documentation
142142 self .server_name = 'XML-RPC Server Documentation'
@@ -170,7 +170,7 @@ def generate_html_documentation(self):
170170 argument string used in the documentation and the
171171 _methodHelp(method_name) method to provide the help text used
172172 in the documentation."""
173-
173+
174174 methods = {}
175175
176176 for method_name in self .system_listMethods ():
@@ -208,7 +208,7 @@ def generate_html_documentation(self):
208208 self .server_documentation ,
209209 methods
210210 )
211-
211+
212212 return documenter .page (self .server_title , documentation )
213213
214214class DocXMLRPCRequestHandler (SimpleXMLRPCRequestHandler ):
@@ -227,7 +227,7 @@ def do_GET(self):
227227 Interpret all HTTP GET requests as requests for server
228228 documentation.
229229 """
230-
230+
231231 response = self .server .generate_html_documentation ()
232232 self .send_response (200 )
233233 self .send_header ("Content-type" , "text/html" )
@@ -251,7 +251,7 @@ def __init__(self, addr, requestHandler=DocXMLRPCRequestHandler,
251251 logRequests = 1 ):
252252 SimpleXMLRPCServer .__init__ (self , addr , requestHandler , logRequests )
253253 XMLRPCDocGenerator .__init__ (self )
254-
254+
255255class DocCGIXMLRPCRequestHandler ( CGIXMLRPCRequestHandler ,
256256 XMLRPCDocGenerator ):
257257 """Handler for XML-RPC data and documentation requests passed through
@@ -281,8 +281,8 @@ def deg_to_rad(deg):
281281
282282 Converts an angle in degrees to an angle in radians"""
283283 import math
284- return deg * math .pi / 180
285-
284+ return deg * math .pi / 180
285+
286286 server = DocXMLRPCServer (("localhost" , 8000 ))
287287
288288 server .set_server_title ("Math Server" )
@@ -299,4 +299,4 @@ def deg_to_rad(deg):
299299 server .register_function (deg_to_rad )
300300 server .register_introspection_functions ()
301301
302- server .serve_forever ()
302+ server .serve_forever ()
0 commit comments