mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-23 20:06:35 +11:00
Merge pull request #81 from ferringb/cleanup_snippets
cleanup_snippets: use self.stdout rather than sys.stdout
This commit is contained in:
commit
9a64fdca29
1 changed files with 3 additions and 3 deletions
|
@ -20,10 +20,10 @@ class Command(LabelCommand):
|
||||||
expire_type=Snippet.EXPIRE_TIME,
|
expire_type=Snippet.EXPIRE_TIME,
|
||||||
expires__lte=timezone.now()
|
expires__lte=timezone.now()
|
||||||
)
|
)
|
||||||
sys.stdout.write(u"%s snippets gets deleted:\n" % deleteable_snippets.count())
|
self.stdout.write(u"%s snippets gets deleted:\n" % deleteable_snippets.count())
|
||||||
for d in deleteable_snippets:
|
for d in deleteable_snippets:
|
||||||
sys.stdout.write(u"- %s (%s)\n" % (d.secret_id, d.expires))
|
self.stdout.write(u"- %s (%s)\n" % (d.secret_id, d.expires))
|
||||||
if options.get('dry_run'):
|
if options.get('dry_run'):
|
||||||
sys.stdout.write(u'Dry run - Not actually deleting snippets!\n')
|
self.stdout.write(u'Dry run - Not actually deleting snippets!\n')
|
||||||
else:
|
else:
|
||||||
deleteable_snippets.delete()
|
deleteable_snippets.delete()
|
||||||
|
|
Loading…
Reference in a new issue