Commit faf36ce6 authored by Tim Peters's avatar Tim Peters

recover(): Changed 'force' and 'partial' arguments to bools. Changed

'pack' default value from 0 to None (this looks like the clear intent
of the code).

Note that fsrecover.py is totally broken, but testRecover.py isn't
detecting it.  I'm working on repairing both.
parent 1791060f
...@@ -239,21 +239,22 @@ def main(): ...@@ -239,21 +239,22 @@ def main():
die("two positional arguments required", show_docstring=True) die("two positional arguments required", show_docstring=True)
inp, outp = args inp, outp = args
force = partial = verbose = 0 force = partial = False
verbose = 0
pack = None pack = None
for opt, v in opts: for opt, v in opts:
if opt == "-v": if opt == "-v":
verbose = int(v) verbose = int(v)
elif opt == "-p": elif opt == "-p":
partial = 1 partial = True
elif opt == "-f": elif opt == "-f":
force = 1 force = True
elif opt == "-P": elif opt == "-P":
pack = time.time() - float(v) pack = time.time() - float(v)
recover(inp, outp, verbose, partial, force, pack) recover(inp, outp, verbose, partial, force, pack)
def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): def recover(inp, outp, verbose=0, partial=False, force=False, pack=None):
print "Recovering", inp, "into", outp print "Recovering", inp, "into", outp
if os.path.exists(outp) and not force: if os.path.exists(outp) and not force:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment