Run save_directory even in trail_run

Might have another config option to make this an optional state?
pull/50/head
Ryan Gibbons 9 years ago
parent 3ef1d1eb64
commit f7606dd056

@ -154,17 +154,17 @@ def remove_things(things):
if max_score is not None and thing.score > max_score: if max_score is not None and thing.score > max_score:
continue continue
if trial_run: # Don't do anything, trial mode!
log.debug("Would have deleted {thing}: '{content}'".format(
thing=thing.id, content=thing))
continue
if save_directory: if save_directory:
if not os.path.exists(save_directory): if not os.path.exists(save_directory):
os.makedirs(save_directory) os.makedirs(save_directory)
with open("%s/%s.json" % (save_directory, thing.id), "w") as fh: with open("%s/%s.json" % (save_directory, thing.id), "w") as fh:
json.dump(thing.json_dict, fh) json.dump(thing.json_dict, fh)
if trial_run: # Don't do anything, trial mode!
log.debug("Would have deleted {thing}: '{content}'".format(
thing=thing.id, content=thing))
continue
if clear_vote: if clear_vote:
thing.clear_vote() thing.clear_vote()

Loading…
Cancel
Save