Changeset 1305
- Timestamp:
- 09/01/06 11:46:15
- Files:
-
- trunk/cherrypy/_cptree.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cptree.py
r1293 r1305 19 19 """ 20 20 21 def __init__(self, root, script_name="" , conf=None):21 def __init__(self, root, script_name=""): 22 22 self.log = _cplogging.LogManager(id(self)) 23 23 self.root = root … … 26 26 } 27 27 self.conf = {} 28 if conf:29 self.merge(conf)30 28 31 29 def _get_script_name(self): … … 43 41 _cpconfig.merge(self.conf, conf) 44 42 45 # Create log handlers as specified in config.43 # Handle namespaces specified in config. 46 44 rootconf = self.conf.get("/", {}) 47 45 for k, v in rootconf.iteritems(): … … 94 92 # Next line both 1) strips trailing slash and 2) maps "/" -> "". 95 93 script_name = script_name.rstrip("/") 96 app = Application(root, script_name, conf) 94 95 if isinstance(root, Application): 96 app = root 97 else: 98 app = Application(root, script_name) 99 100 # If mounted at "", add favicon.ico 101 if script_name == "" and root and not hasattr(root, "favicon_ico"): 102 import os 103 from cherrypy import tools 104 favicon = os.path.join(os.getcwd(), os.path.dirname(__file__), 105 "favicon.ico") 106 root.favicon_ico = tools.staticfile.handler(favicon) 107 108 if conf: 109 app.merge(conf) 110 97 111 self.apps[script_name] = app 98 99 # If mounted at "", add favicon.ico100 if script_name == "" and root and not hasattr(root, "favicon_ico"):101 import os102 from cherrypy import tools103 favicon = os.path.join(os.getcwd(), os.path.dirname(__file__),104 "favicon.ico")105 root.favicon_ico = tools.staticfile.handler(favicon)106 112 107 113 return app

