From ac40aee805a7289a721469b50f146d5c3801cdfe Mon Sep 17 00:00:00 2001 From: Daniel Quinn <code@danielquinn.org> Date: Sat, 5 Mar 2016 12:31:43 +0000 Subject: [PATCH] Added some nice output so the migration is less scary --- .../migrations/0012_auto_20160305_0040.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/documents/migrations/0012_auto_20160305_0040.py b/src/documents/migrations/0012_auto_20160305_0040.py index 876c2c68e..618ace5d8 100644 --- a/src/documents/migrations/0012_auto_20160305_0040.py +++ b/src/documents/migrations/0012_auto_20160305_0040.py @@ -11,6 +11,7 @@ import tempfile from django.conf import settings from django.db import migrations +from django.utils.termcolors import colorize as colourise # Spelling hurts me class GnuPG(object): @@ -42,14 +43,25 @@ def move_documents_and_create_thumbnails(apps, schema_editor): if not documents: return - print("\n") + print(colourise( + "\n\n" + " This is a one-time only migration to generate thumbnails for all of your\n" + " documents so that future UIs will have something to work with. If you have\n" + " a lot of documents though, this may take a while, so a coffee break may be\n" + " in order." + "\n", opts=("bold",) + )) for f in sorted(documents): if not f.endswith("gpg"): continue - print(" * Generating a thumbnail for {}".format(f)) + print(" {} {} {}".format( + colourise("*", fg="green"), + colourise("Generating a thumbnail for", fg="white"), + colourise(f, fg="cyan") + )) thumb_temp = tempfile.mkdtemp( prefix="paperless", dir=settings.SCRATCH_DIR)