MCPcopy Create free account
hub / github.com/datapane/datapane / _mount_app

Method _mount_app

python-client/src/datapane/_vendor/bottle.py:738–759  ·  view source on GitHub ↗
(self, prefix, app, **options)

Source from the content-addressed store, hash-verified

736 self.route('/' + '/'.join(segments), **options)
737
738 def _mount_app(self, prefix, app, **options):
739 if app in self._mounts or '_mount.app' in app.config:
740 depr(0, 13, "Application mounted multiple times. Falling back to WSGI mount.",
741 "Clone application before mounting to a different location.")
742 return self._mount_wsgi(prefix, app, **options)
743
744 if options:
745 depr(0, 13, "Unsupported mount options. Falling back to WSGI mount.",
746 "Do not specify any route options when mounting bottle application.")
747 return self._mount_wsgi(prefix, app, **options)
748
749 if not prefix.endswith("/"):
750 depr(0, 13, "Prefix must end in '/'. Falling back to WSGI mount.",
751 "Consider adding an explicit redirect from '/prefix' to '/prefix/' in the parent application.")
752 return self._mount_wsgi(prefix, app, **options)
753
754 self._mounts.append(app)
755 app.config['_mount.prefix'] = prefix
756 app.config['_mount.app'] = self
757 for route in app.routes:
758 route.rule = prefix + route.rule.lstrip('/')
759 self.add_route(route)
760
761 def mount(self, prefix, app, **options):
762 """ Mount an application (:class:`Bottle` or plain WSGI) to a specific

Callers 1

mountMethod · 0.95

Calls 4

_mount_wsgiMethod · 0.95
add_routeMethod · 0.95
deprFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected