summaryrefslogtreecommitdiff
path: root/repoze/bfg/scripting.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-05-27 15:47:11 +0000
committerChris McDonough <chrism@agendaless.com>2009-05-27 15:47:11 +0000
commit156375861f191f51f4e97ce25cd4d39f8025f90b (patch)
treeead4a91f8781cc26b6754e496d5e52399568edbe /repoze/bfg/scripting.py
parent711b60c05b9573f688994233ec1baac3f89bc45a (diff)
downloadpyramid-156375861f191f51f4e97ce25cd4d39f8025f90b.tar.gz
pyramid-156375861f191f51f4e97ce25cd4d39f8025f90b.tar.bz2
pyramid-156375861f191f51f4e97ce25cd4d39f8025f90b.zip
- A paster command has been added named "bfgshell". This command can
be used to get an interactive prompt with your BFG root object in the global namespace. E.g.:: bin/paster bfgshell /path/to/myapp.ini myapp See the ``Project`` chapter in the BFG documentation for more information.
Diffstat (limited to 'repoze/bfg/scripting.py')
-rw-r--r--repoze/bfg/scripting.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/repoze/bfg/scripting.py b/repoze/bfg/scripting.py
deleted file mode 100644
index 9e83e2fe8..000000000
--- a/repoze/bfg/scripting.py
+++ /dev/null
@@ -1,18 +0,0 @@
-_GET_ROOT_ENVIRON = {}
-
-def get_root(router):
- """ Given a :mod:`repoze.bfg` Router application instance as its
- ``router`` argument, this callable returns the traversal root of
- graph as defined by the application's root factory. It also has
- the effect of pushing a new registry and request on to the
- internal thread local stack managed by BFG so that registry
- lookups work properly.
-
- .. warning:: This function should never be called from *within* a
- BFG model or view, only from top-level scripts which wish to
- get the root of a graph to do offline processing."""
- registry = router.registry
- threadlocals = {'registry':registry, 'request':None}
- router.threadlocal_manager.push(threadlocals)
- return router.root_factory(_GET_ROOT_ENVIRON)
-