However, the only bold green style I found was "MIGRATE_SUCCESS", but it
feels odd using this in my management command since it has nothing to do
with migrations.
Could I add a generic "SUCCESS" style that is the same as
"MIGRATE_SUCCESS" or should these styles not be used by third party
management commands?
--
Ticket URL: <https://code.djangoproject.com/ticket/25439>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "termcolor-styles.png" added.
Management command termcolors
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> I've just created a management command that shows if something was
> successful or whether an error was encountered trying to perform the
> task. I looked at the palettes in "django/utils/termcolors.py" to find a
> bold red for displaying the error and found it was called "ERROR".
>
> However, the only bold green style I found was "MIGRATE_SUCCESS", but it
> feels odd using this in my management command since it has nothing to do
> with migrations.
>
> Could I add a generic "SUCCESS" style that is the same as
> "MIGRATE_SUCCESS" or should these styles not be used by third party
> management commands?
New description:
I've just created a management command that shows if something was
successful or whether an error was encountered trying to perform the task.
I looked at the palettes in "django/utils/termcolors.py" to find a bold
red for displaying the error and found it was called "ERROR".
However, the only bold green style I found was "MIGRATE_SUCCESS", but it
feels odd using this in my management command since it has nothing to do
with migrations.
Could I add a generic "SUCCESS" style that is the same as
"MIGRATE_SUCCESS" or should these styles not be used by third party
management commands?
Edit: added a screencap of all the styles.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/25439#comment:1>
* stage: Unreviewed => Accepted
Comment:
Looks like a generic SUCCESS style would be a nice addition.
--
Ticket URL: <https://code.djangoproject.com/ticket/25439#comment:2>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/25439#comment:3>
* version: 1.8 => master
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/25439#comment:4>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"f06ce6053cae6a96ecce29ce2020789945757bf4" f06ce605]:
{{{
#!CommitTicketReference repository=""
revision="f06ce6053cae6a96ecce29ce2020789945757bf4"
Fixed #25439 -- Added `SUCCESS` style to termcolor palettes
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25439#comment:5>