Anonymous avatar Anonymous committed 175e2cd

getSpecialFunction renamed getSpecialAttribute

Comments (0)

Files changed (10)

+2005-06-11:
+    * getSpecialFunction renamed getSpecialAttribute (mikerobi)
+
 2005-06-10:
     * New test suite (no forks, no exec). (fumanchu)
     * New lib/profiler module. (fumanchu)

cherrypy/_cpconfig.py

 
 def _load(configFile = None):
     """ Convert an INI file to a dictionary """
-    _cpLogMessage = _cputil.getSpecialFunction('_cpLogMessage')
+    _cpLogMessage = _cputil.getSpecialAttribute('_cpLogMessage')
 
     # Parse config file
     configParser = CaseSensitiveConfigParser()
             configMap[section][option] = value
 
 def outputConfigMap():
-    _cpLogMessage = _cputil.getSpecialFunction('_cpLogMessage')
+    _cpLogMessage = _cputil.getSpecialAttribute('_cpLogMessage')
     _cpLogMessage("Server parameters:", 'CONFIG')
     _cpLogMessage("  server.environment: %s" % get('server.environment'), 'CONFIG')
     _cpLogMessage("  server.logToScreen: %s" % get('server.logToScreen'), 'CONFIG')

cherrypy/_cphttpserver.py

     
     def log_message(self, format, *args):
         """ We have to override this to use our own logging mechanism """
-        _cputil.getSpecialFunction('_cpLogMessage')(format % args, "HTTP")
+        _cputil.getSpecialAttribute('_cpLogMessage')(format % args, "HTTP")
 
 
 class CherryHTTPServer(BaseHTTPServer.HTTPServer):
             # interrupts on Win32, which don't interrupt accept() by default
             return 1
         except (KeyboardInterrupt, SystemExit):
-            _cputil.getSpecialFunction('_cpLogMessage')("<Ctrl-C> hit: shutting down http server", "HTTP")
+            _cputil.getSpecialAttribute('_cpLogMessage')("<Ctrl-C> hit: shutting down http server", "HTTP")
             self.shutdown()
     
     def serve_forever(self):
     def handle_error(self, request, client_address):
         """Handle an error gracefully.  May be overridden."""
         errorBody = _cphttptools.formatExc()
-        _cputil.getSpecialFunction('_cpLogMessage')(errorBody)
+        _cputil.getSpecialAttribute('_cpLogMessage')(errorBody)
 
 
 class PooledThreadServer(SocketServer.TCPServer):
         try:
             request, client_address = self.get_request()
         except (KeyboardInterrupt, SystemExit):
-            _cputil.getSpecialFunction('_cpLogMessage')("<Ctrl-C> hit: shutting down", "HTTP")
+            _cputil.getSpecialAttribute('_cpLogMessage')("<Ctrl-C> hit: shutting down", "HTTP")
             return 0
         except socket.error, e:
             return 1

cherrypy/_cphttptools.py

         except:
             pass
         msg = "%s - %s" % (cpg.request.remoteAddr, self.requestLine[:-2])
-        _cputil.getSpecialFunction('_cpLogMessage')(msg, "HTTP")
+        _cputil.getSpecialAttribute('_cpLogMessage')(msg, "HTTP")
         
         cpg.request.base = "http://" + cpg.request.headerMap.get('Host', '')
         cpg.request.browserUrl = cpg.request.base + path
         
         # _cpOnError will probably change cpg.response.body.
         # It may also change the headerMap, etc.
-        _cputil.getSpecialFunction('_cpOnError')()
+        _cputil.getSpecialAttribute('_cpOnError')()
         
         finalize()
         
 def applyFilters(methodName):
     if methodName in ('beforeRequestBody', 'beforeMain'):
         filterList = (_cpdefaults._cpDefaultInputFilterList +
-                      _cputil.getSpecialFunction('_cpFilterList'))
+                      _cputil.getSpecialAttribute('_cpFilterList'))
     elif methodName in ('beforeFinalize',):
-        filterList = (_cputil.getSpecialFunction('_cpFilterList') +
+        filterList = (_cputil.getSpecialAttribute('_cpFilterList') +
                       _cpdefaults._cpDefaultOutputFilterList)
     else:
         # 'onStartResource', 'onEndResource'
         # 'beforeErrorResponse', 'afterErrorResponse'
         filterList = (_cpdefaults._cpDefaultInputFilterList +
-                      _cputil.getSpecialFunction('_cpFilterList') +
+                      _cputil.getSpecialAttribute('_cpFilterList') +
                       _cpdefaults._cpDefaultOutputFilterList)
     for filter in filterList:
         method = getattr(filter, methodName, None)

cherrypy/_cpserver.py

     
     cpg._httpserver = serverClass()
     
-    _cpLogMessage = _cputil.getSpecialFunction('_cpLogMessage')
+    _cpLogMessage = _cputil.getSpecialAttribute('_cpLogMessage')
     
     servingWhat = "HTTP"
     if cpg.config.get('server', 'socketPort'):

cherrypy/_cputil.py

     """ An empty class """
     pass
 
-def getSpecialFunction(name):
+def getSpecialAttribute(name):
     """ Return the special function """
 
     # First, we look in the right-most object if this special function is implemented.

cherrypy/_cpwsgi.py

             yield str(chunk)
     except:
         tb = _cphttptools.formatExc()
-        _cputil.getSpecialFunction('_cpLogMessage')(tb)
+        _cputil.getSpecialAttribute('_cpLogMessage')(tb)
         s, h, b = _cphttptools.bareError(tb)
         # CherryPy test suite expects bareError body to be output,
         # so don't call start_response (which, according to PEP 333,
     def handleError(self, exc):
         self.close_connection = 1
         msg = _cphttptools.formatExc(exc)
-        _cputil.getSpecialFunction('_cpLogMessage')(msg, "HTTP")
+        _cputil.getSpecialAttribute('_cpLogMessage')(msg, "HTTP")
         self.status, self.headers, body = _cphttptools.bareError()
         self.write(body)
 

cherrypy/lib/autoreload.py

         try:
             sys.exit(restart_with_reloader())
         except KeyboardInterrupt:
-            _cputil.getSpecialFunction('_cpLogMessage')("<Ctrl-C> hit: shutting down autoreloader", "HTTP")
+            _cputil.getSpecialAttribute('_cpLogMessage')("<Ctrl-C> hit: shutting down autoreloader", "HTTP")

cherrypy/lib/filter/sessionfilter/basesession.py

         sessionKeyFunc = cpg.config.get('%s.keyMaker' % self.sessionName, None)
         
         if sessionKeyFunc:
-            newKey = cherrypy._cputil.getSpecialFunction(sessionKeyFunc)()
+            newKey = cherrypy._cputil.getSpecialAttribute(sessionKeyFunc)()
         else:
             s = ''
             for i in range(50):

cherrypy/lib/filter/sessionfilter/sessionfilter.py

                 storageType = cpg.config.get('%s.customStorageClass' % sessionName)
                 if storageType:
                     try:
-                        cherrypy._cputil.getSpecialFunction(storageType)
+                        cherrypy._cputil.getSpecialAttribute(storageType)
                     except cherrypy.cperror.InternalError:
                         raise SessionBadStorageTypeError(storageType)
                 raise
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.