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

Function load_app

python-client/src/datapane/_vendor/bottle.py:3607–3619  ·  view source on GitHub ↗

Load a bottle application from a module and make sure that the import does not affect the current default application, but returns a separate application object. See :func:`load` for the target parameter.

(target)

Source from the content-addressed store, hash-verified

3605
3606
3607def load_app(target):
3608 """ Load a bottle application from a module and make sure that the import
3609 does not affect the current default application, but returns a separate
3610 application object. See :func:`load` for the target parameter. """
3611 global NORUN
3612 NORUN, nr_old = True, NORUN
3613 tmp = default_app.push() # Create a new "default application"
3614 try:
3615 rv = load(target) # Import the target module
3616 return rv if callable(rv) else tmp
3617 finally:
3618 default_app.remove(tmp) # Remove the temporary added default application
3619 NORUN = nr_old
3620
3621
3622_debug = debug

Callers 1

runFunction · 0.85

Calls 2

pushMethod · 0.80
loadFunction · 0.70

Tested by

no test coverage detected