Changeset 947
- Timestamp:
- 01/27/06 06:16:46
- Files:
-
- trunk/cherrypy/__init__.py (modified) (1 diff)
- trunk/cherrypy/config.py (modified) (3 diffs)
- trunk/cherrypy/filters/__init__.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/__init__.py
r939 r947 15 15 # Legacy code may clobber this. 16 16 root = None 17 18 lowercase_api = False 17 19 18 20 import _cpserver trunk/cherrypy/config.py
r913 r947 116 116 path = "/" 117 117 118 try: 119 result = configs[path][_cputil.lower_to_camel(key)] 120 break 121 except KeyError: 118 if cherrypy.lowercase_api is False: 119 # We don't know for sure if user uses the new lowercase API 120 try: 121 result = configs[path][_cputil.lower_to_camel(key)] 122 break 123 except KeyError: 124 try: 125 result = configs[path][key] 126 break 127 except KeyError: 128 pass 129 pass 130 131 try: 132 # Check for a server.environment entry at this node. 133 env = configs[path]["server.environment"] 134 # For backward compatibility, check for camelCase key first 135 result = environments[env][_cputil.lower_to_camel(key)] 136 break 137 except KeyError: 138 try: 139 env = configs[path]["server.environment"] 140 result = environments[env][key] 141 break 142 except KeyError: 143 pass 144 pass 145 else: 146 # We know for sure that user uses the new lowercase api 122 147 try: 123 148 result = configs[path][key] … … 125 150 except KeyError: 126 151 pass 127 pass 128 129 try: 130 # Check for a server.environment entry at this node. 131 env = configs[path]["server.environment"] 132 # For backward compatibility, check for camelCase key first 133 result = environments[env][_cputil.lower_to_camel(key)] 134 break 135 except KeyError: 152 136 153 try: 137 154 env = configs[path]["server.environment"] … … 141 158 pass 142 159 pass 143 160 144 161 if path == "global": 145 162 result = default_value trunk/cherrypy/filters/__init__.py
r911 r947 99 99 special_methods = [] 100 100 for f in _cputil.get_special_attribute("_cp_filters", "_cpFilterList"): 101 # Try old name first 102 old_method_name = backward_compatibility_dict.get(method_name) 103 method = getattr(f, old_method_name, None) 104 if (method is None): 101 if cherrypy.lowercase_api is False: 102 # Try old name first 103 old_method_name = backward_compatibility_dict.get(method_name) 104 method = getattr(f, old_method_name, None) 105 if (method is None): 106 method = getattr(f, method_name, None) 107 if method: 108 special_methods.append(method) 109 else: 110 # We know for sure that user uses the new lowercase API 105 111 method = getattr(f, method_name, None) 106 if method:107 special_methods.append(method)112 if method: 113 special_methods.append(method) 108 114 109 115 if method_name in _input_methods:

