I'm using Python + ZOPE/ZODB/Repoze BFG (the acronyms all get quite confusing) + paster.
I have a paster shell that I can run by doing:
paster --plugin repoze.bfg bfgshell site.ini zodb
Everything works fine. However, I have a bunch of monitoring stuff that gets turned on - threads that print debug info to stdout - that really don't need to be running when I'm just starting the shell. Would it be possible to somehow detect whether the startup code is running in the shell? Thus if the code detects the shell is not on, it will start those threads, and if the shell is on, it won't.