|
|
@ -89,7 +89,7 @@ if keep_a_copy:
|
|
|
|
if verbose:
|
|
|
|
if verbose:
|
|
|
|
print("Saving {user}'s stuff in {name}".format(user=r.user, name=fname))
|
|
|
|
print("Saving {user}'s stuff in {name}".format(user=r.user, name=fname))
|
|
|
|
copy_file = open(fname, 'w')
|
|
|
|
copy_file = open(fname, 'w')
|
|
|
|
|
|
|
|
|
|
|
|
if verbose:
|
|
|
|
if verbose:
|
|
|
|
print("Deleting messages before {time}.".format(
|
|
|
|
print("Deleting messages before {time}.".format(
|
|
|
|
time=datetime.now() - timedelta(hours=hours))
|
|
|
|
time=datetime.now() - timedelta(hours=hours))
|
|
|
@ -153,9 +153,9 @@ for thing in things:
|
|
|
|
elif 'selftext_html' in d:
|
|
|
|
elif 'selftext_html' in d:
|
|
|
|
del d['selftext_html']
|
|
|
|
del d['selftext_html']
|
|
|
|
thing_json = json.dumps(d)
|
|
|
|
thing_json = json.dumps(d)
|
|
|
|
|
|
|
|
|
|
|
|
if isinstance(thing, Submission):
|
|
|
|
if isinstance(thing, Submission):
|
|
|
|
if verbose && keep_a_copy:
|
|
|
|
if verbose and keep_a_copy:
|
|
|
|
print('Saving a copy of submission: #{id} {url}'.format(
|
|
|
|
print('Saving a copy of submission: #{id} {url}'.format(
|
|
|
|
id=thing.id,
|
|
|
|
id=thing.id,
|
|
|
|
url=thing.url)
|
|
|
|
url=thing.url)
|
|
|
@ -180,11 +180,12 @@ for thing in things:
|
|
|
|
print('Editing {msg}'.format(msg=msg))
|
|
|
|
print('Editing {msg}'.format(msg=msg))
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
print('Editing and deleting {msg}'.format(msg=msg))
|
|
|
|
print('Editing and deleting {msg}'.format(msg=msg))
|
|
|
|
|
|
|
|
|
|
|
|
if keep_a_copy:
|
|
|
|
if keep_a_copy:
|
|
|
|
copy_file.write(thing_json + '\n')
|
|
|
|
copy_file.write(thing_json + '\n')
|
|
|
|
thing.edit(replacement_text)
|
|
|
|
thing.edit(replacement_text)
|
|
|
|
if not edit_only:
|
|
|
|
if not edit_only:
|
|
|
|
thing.delete()
|
|
|
|
thing.delete()
|
|
|
|
|
|
|
|
|
|
|
|
copy_file.close()
|
|
|
|
if keep_a_copy:
|
|
|
|
|
|
|
|
copy_file.close()
|
|
|
|