From f7606dd0560ae0d403fd99ca8937e9091b8a76a9 Mon Sep 17 00:00:00 2001 From: Ryan Gibbons Date: Sat, 27 Feb 2016 11:12:50 -0600 Subject: [PATCH] Run save_directory even in trail_run Might have another config option to make this an optional state? --- shreddit.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shreddit.py b/shreddit.py index e413d3d..ee8f981 100755 --- a/shreddit.py +++ b/shreddit.py @@ -153,18 +153,18 @@ def remove_things(things): continue if max_score is not None and thing.score > max_score: 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 not os.path.exists(save_directory): os.makedirs(save_directory) with open("%s/%s.json" % (save_directory, thing.id), "w") as 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: thing.clear_vote()