Ticket #446: conf_mount_point.patch
-
_cptree.py
old new 18 18 def __init__(self): 19 19 self.mount_points = {} 20 20 21 def mount(self, app_root, baseurl= "/", conf=None):21 def mount(self, app_root, baseurl=None, conf=None): 22 22 """Mount the given app_root at the given baseurl (relative to root).""" 23 23 import cherrypy 24 24 25 if conf and not isinstance(conf, dict): 26 conf = cherrypy.config.dict_from_config_file(conf) 27 28 if baseurl is None: 29 baseurl = "/" 30 if conf: 31 conf_pt = conf.get("global", {}).get("mount_point") 32 if conf_pt: 33 baseurl = conf_pt 34 25 35 point = baseurl.lstrip("/") 26 36 if point: 27 37 node = cherrypy.root … … 46 56 self.mount_points[baseurl] = app_root 47 57 48 58 if conf is not None: 49 if isinstance(conf, dict): 50 cherrypy.config.update(updateMap=conf, baseurl=baseurl) 51 else: 52 cherrypy.config.update(file=conf, baseurl=baseurl) 59 cherrypy.config.update(updateMap=conf, baseurl=baseurl) 53 60 54 61 def mount_point(self, path=None): 55 62 """The 'root path' of the app which governs the given path, or None.

