summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-07-26 16:52:17 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-07-26 16:52:17 +0100
commitd5ca1693341daccce9b0dd8504967a56b289d92f (patch)
treef53b4a01db804e4cd299c24d00f3cbef98456c03
parent52643a69e3fac42c14143f3ca71ec9f5b7e64296 (diff)
Fix "OK" alignment in migrate output
-rw-r--r--django/core/management/commands/migrate.py8
-rw-r--r--django/utils/termcolors.py6
2 files changed, 10 insertions, 4 deletions
diff --git a/django/core/management/commands/migrate.py b/django/core/management/commands/migrate.py
index 73d453cf99..d9a677e567 100644
--- a/django/core/management/commands/migrate.py
+++ b/django/core/management/commands/migrate.py
@@ -116,15 +116,15 @@ class Command(BaseCommand):
def migration_progress_callback(self, action, migration):
if self.verbosity >= 1:
if action == "apply_start":
- self.stdout.write(" Applying %s... " % migration)
+ self.stdout.write(" Applying %s..." % migration, ending="")
self.stdout.flush()
elif action == "apply_success":
- self.stdout.write(" OK\n")
+ self.stdout.write(self.style.MIGRATE_SUCCESS(" OK"))
elif action == "unapply_start":
- self.stdout.write(" Unapplying %s... " % migration)
+ self.stdout.write(" Unapplying %s..." % migration, ending="")
self.stdout.flush()
elif action == "unapply_success":
- self.stdout.write(" OK\n")
+ self.stdout.write(self.style.MIGRATE_SUCCESS(" OK"))
def sync_apps(self, connection, apps):
"Runs the old syncdb-style operation on a list of apps."
diff --git a/django/utils/termcolors.py b/django/utils/termcolors.py
index 3562fa4fb5..95d0d17f0f 100644
--- a/django/utils/termcolors.py
+++ b/django/utils/termcolors.py
@@ -88,6 +88,8 @@ PALETTES = {
'HTTP_SERVER_ERROR': {},
'MIGRATE_HEADING': {},
'MIGRATE_LABEL': {},
+ 'MIGRATE_SUCCESS': {},
+ 'MIGRATE_FAILURE': {},
},
DARK_PALETTE: {
'ERROR': { 'fg': 'red', 'opts': ('bold',) },
@@ -105,6 +107,8 @@ PALETTES = {
'HTTP_SERVER_ERROR': { 'fg': 'magenta', 'opts': ('bold',) },
'MIGRATE_HEADING': { 'fg': 'cyan', 'opts': ('bold',) },
'MIGRATE_LABEL': { 'opts': ('bold',) },
+ 'MIGRATE_SUCCESS': { 'fg': 'green', 'opts': ('bold',) },
+ 'MIGRATE_FAILURE': { 'fg': 'red', 'opts': ('bold',) },
},
LIGHT_PALETTE: {
'ERROR': { 'fg': 'red', 'opts': ('bold',) },
@@ -122,6 +126,8 @@ PALETTES = {
'HTTP_SERVER_ERROR': { 'fg': 'magenta', 'opts': ('bold',) },
'MIGRATE_HEADING': { 'fg': 'cyan', 'opts': ('bold',) },
'MIGRATE_LABEL': { 'opts': ('bold',) },
+ 'MIGRATE_SUCCESS': { 'fg': 'green', 'opts': ('bold',) },
+ 'MIGRATE_FAILURE': { 'fg': 'red', 'opts': ('bold',) },
}
}
DEFAULT_PALETTE = DARK_PALETTE