Move atoi() into atoi.py and add a new debug2() debug level.
atoi() was getting redundant, and unfortunately we can't easily load helpers.py in some places where we'd want to, because it depends on vars.py. So move it to its own module.
This commit is contained in:
parent
75063244b2
commit
94b0e7166e
5 changed files with 19 additions and 21 deletions
12
helpers.py
12
helpers.py
|
|
@ -2,13 +2,6 @@ import sys, os, errno
|
|||
import vars
|
||||
|
||||
|
||||
def atoi(v):
|
||||
try:
|
||||
return int(v or 0)
|
||||
except ValueError:
|
||||
return 0
|
||||
|
||||
|
||||
def unlink(f):
|
||||
"""Delete a file at path 'f' if it currently exists.
|
||||
|
||||
|
|
@ -68,7 +61,10 @@ else:
|
|||
|
||||
|
||||
def debug(s):
|
||||
if vars.DEBUG:
|
||||
if vars.DEBUG >= 1:
|
||||
_log('redo: %s%s' % (vars.DEPTH, s))
|
||||
def debug2(s):
|
||||
if vars.DEBUG >= 2:
|
||||
_log('redo: %s%s' % (vars.DEPTH, s))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue