mirror of
https://github.com/django/django.git
synced 2025-05-04 22:17:34 +00:00
Removed redundant termcolors.
Replaced MIGRATE_SUCCESS and MIGRATE_FAILURE with SUCCESS and ERROR.
This commit is contained in:
parent
b3acdeee50
commit
c7adfe941b
@ -191,9 +191,9 @@ class Command(BaseCommand):
|
|||||||
elif action == "apply_success":
|
elif action == "apply_success":
|
||||||
elapsed = " (%.3fs)" % (time.time() - self.start) if compute_time else ""
|
elapsed = " (%.3fs)" % (time.time() - self.start) if compute_time else ""
|
||||||
if fake:
|
if fake:
|
||||||
self.stdout.write(self.style.MIGRATE_SUCCESS(" FAKED" + elapsed))
|
self.stdout.write(self.style.SUCCESS(" FAKED" + elapsed))
|
||||||
else:
|
else:
|
||||||
self.stdout.write(self.style.MIGRATE_SUCCESS(" OK" + elapsed))
|
self.stdout.write(self.style.SUCCESS(" OK" + elapsed))
|
||||||
elif action == "unapply_start":
|
elif action == "unapply_start":
|
||||||
if compute_time:
|
if compute_time:
|
||||||
self.start = time.time()
|
self.start = time.time()
|
||||||
@ -202,9 +202,9 @@ class Command(BaseCommand):
|
|||||||
elif action == "unapply_success":
|
elif action == "unapply_success":
|
||||||
elapsed = " (%.3fs)" % (time.time() - self.start) if compute_time else ""
|
elapsed = " (%.3fs)" % (time.time() - self.start) if compute_time else ""
|
||||||
if fake:
|
if fake:
|
||||||
self.stdout.write(self.style.MIGRATE_SUCCESS(" FAKED" + elapsed))
|
self.stdout.write(self.style.SUCCESS(" FAKED" + elapsed))
|
||||||
else:
|
else:
|
||||||
self.stdout.write(self.style.MIGRATE_SUCCESS(" OK" + elapsed))
|
self.stdout.write(self.style.SUCCESS(" OK" + elapsed))
|
||||||
elif action == "render_start":
|
elif action == "render_start":
|
||||||
if compute_time:
|
if compute_time:
|
||||||
self.start = time.time()
|
self.start = time.time()
|
||||||
@ -212,7 +212,7 @@ class Command(BaseCommand):
|
|||||||
self.stdout.flush()
|
self.stdout.flush()
|
||||||
elif action == "render_success":
|
elif action == "render_success":
|
||||||
elapsed = " (%.3fs)" % (time.time() - self.start) if compute_time else ""
|
elapsed = " (%.3fs)" % (time.time() - self.start) if compute_time else ""
|
||||||
self.stdout.write(self.style.MIGRATE_SUCCESS(" DONE" + elapsed))
|
self.stdout.write(self.style.SUCCESS(" DONE" + elapsed))
|
||||||
|
|
||||||
def sync_apps(self, connection, app_labels):
|
def sync_apps(self, connection, app_labels):
|
||||||
"Runs the old syncdb-style operation on a list of app_labels."
|
"Runs the old syncdb-style operation on a list of app_labels."
|
||||||
|
@ -74,7 +74,7 @@ class Command(BaseCommand):
|
|||||||
shown.add(plan_node)
|
shown.add(plan_node)
|
||||||
# If we didn't print anything, then a small message
|
# If we didn't print anything, then a small message
|
||||||
if not shown:
|
if not shown:
|
||||||
self.stdout.write(" (no migrations)", self.style.MIGRATE_FAILURE)
|
self.stdout.write(" (no migrations)", self.style.ERROR)
|
||||||
|
|
||||||
def show_plan(self, connection):
|
def show_plan(self, connection):
|
||||||
"""
|
"""
|
||||||
|
@ -92,8 +92,6 @@ PALETTES = {
|
|||||||
'HTTP_SERVER_ERROR': {},
|
'HTTP_SERVER_ERROR': {},
|
||||||
'MIGRATE_HEADING': {},
|
'MIGRATE_HEADING': {},
|
||||||
'MIGRATE_LABEL': {},
|
'MIGRATE_LABEL': {},
|
||||||
'MIGRATE_SUCCESS': {},
|
|
||||||
'MIGRATE_FAILURE': {},
|
|
||||||
},
|
},
|
||||||
DARK_PALETTE: {
|
DARK_PALETTE: {
|
||||||
'ERROR': {'fg': 'red', 'opts': ('bold',)},
|
'ERROR': {'fg': 'red', 'opts': ('bold',)},
|
||||||
@ -113,8 +111,6 @@ PALETTES = {
|
|||||||
'HTTP_SERVER_ERROR': {'fg': 'magenta', 'opts': ('bold',)},
|
'HTTP_SERVER_ERROR': {'fg': 'magenta', 'opts': ('bold',)},
|
||||||
'MIGRATE_HEADING': {'fg': 'cyan', 'opts': ('bold',)},
|
'MIGRATE_HEADING': {'fg': 'cyan', 'opts': ('bold',)},
|
||||||
'MIGRATE_LABEL': {'opts': ('bold',)},
|
'MIGRATE_LABEL': {'opts': ('bold',)},
|
||||||
'MIGRATE_SUCCESS': {'fg': 'green', 'opts': ('bold',)},
|
|
||||||
'MIGRATE_FAILURE': {'fg': 'red', 'opts': ('bold',)},
|
|
||||||
},
|
},
|
||||||
LIGHT_PALETTE: {
|
LIGHT_PALETTE: {
|
||||||
'ERROR': {'fg': 'red', 'opts': ('bold',)},
|
'ERROR': {'fg': 'red', 'opts': ('bold',)},
|
||||||
@ -134,8 +130,6 @@ PALETTES = {
|
|||||||
'HTTP_SERVER_ERROR': {'fg': 'magenta', 'opts': ('bold',)},
|
'HTTP_SERVER_ERROR': {'fg': 'magenta', 'opts': ('bold',)},
|
||||||
'MIGRATE_HEADING': {'fg': 'cyan', 'opts': ('bold',)},
|
'MIGRATE_HEADING': {'fg': 'cyan', 'opts': ('bold',)},
|
||||||
'MIGRATE_LABEL': {'opts': ('bold',)},
|
'MIGRATE_LABEL': {'opts': ('bold',)},
|
||||||
'MIGRATE_SUCCESS': {'fg': 'green', 'opts': ('bold',)},
|
|
||||||
'MIGRATE_FAILURE': {'fg': 'red', 'opts': ('bold',)},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DEFAULT_PALETTE = DARK_PALETTE
|
DEFAULT_PALETTE = DARK_PALETTE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user