Move setproctitle() stuff into title.py.
This removes another instance of magical code running at module import time. And the process title wasn't really part of the state database anyway. Unfortunately this uncovered a bug: the recent change to use 'python -S' makes it not find the setproctitle module if installed. My goodness, I hate the horrible python easy_install module gunk that makes startup linearly slower the more modules you have installed, whether you import them or not, if you don't use -S. But oh well, we're stuck with it for now.
This commit is contained in:
parent
9b6d1eeb6e
commit
0b648521fd
3 changed files with 20 additions and 12 deletions
|
|
@ -3,17 +3,6 @@ import cycles, env
|
|||
from helpers import unlink, close_on_exec, join
|
||||
from logs import warn, debug2, debug3
|
||||
|
||||
# When the module is imported, change the process title.
|
||||
# We do it here because this module is imported by all the scripts.
|
||||
try:
|
||||
from setproctitle import setproctitle
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
cmdline = sys.argv[:]
|
||||
cmdline[0] = os.path.splitext(os.path.basename(cmdline[0]))[0]
|
||||
setproctitle(" ".join(cmdline))
|
||||
|
||||
SCHEMA_VER = 2
|
||||
TIMEOUT = 60
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue