The only thing in helpers.py that needed vars.py was the log stuff.

So put it in its own file.  Now it's safer to import and use helpers even if
you can't safely touch vars.
This commit is contained in:
Avery Pennarun 2010-12-11 18:32:40 -08:00
commit e18fa85d58
12 changed files with 72 additions and 69 deletions

View file

@ -1,6 +1,7 @@
#!/usr/bin/python
import sys, os
import options, jwack, atoi
import options
from helpers import atoi
optspec = """
redo [targets...]
@ -57,15 +58,15 @@ if is_root:
os.environ['REDO'] = os.path.abspath(sys.argv[0])
import vars, state, builder
from helpers import err
import vars, state, builder, jwack
from log import err
if is_root:
state.init()
try:
j = atoi.atoi(opt.jobs or 1)
j = atoi(opt.jobs or 1)
if j < 1 or j > 1000:
err('invalid --jobs value: %r\n' % opt.jobs)
jwack.setup(j)