[Django] #29560: Add an option to django-admin to always colorize output

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #29560: Add an option to django-admin to always colorize output

Django
#29560: Add an option to django-admin to always colorize output
-------------------------------------+-------------------------------------
               Reporter:  Nicolas    |          Owner:  nobody
  Noé                                |
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:  Core       |        Version:  master
  (Management commands)              |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 With Django management commands, it is currently possible disable colors
 with the `--no-colors` flag.

 What I'd like to have is basically the other side of the coin: a `--force-
 colors` flag that instructs Django to output ANSI color sequences in cases
 it would disable colors by default (typically, when the output is piped to
 another command, as documented).

 My real world use-case is the following one: I have a custom Django
 command to import data. I run this command myself, and I'd like to send a
 colored log (HTML seems perfect for this) to the data curators. I can use
 the https://github.com/theZiz/aha utility for this, but that doesn't work
 since Django disable colors when the output is piped.

 Other *nix commands have a special flag for this exact use-case, for
 example `$ ls --color=always`

--
Ticket URL: <https://code.djangoproject.com/ticket/29560>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/050.d98694c8cf5039208c360baefd49d603%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29560: Add an option to django-admin to always colorize output

Django
#29560: Add an option to django-admin to always colorize output
-------------------------------------+-------------------------------------
     Reporter:  Nicolas Noé          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Core (Management     |                  Version:  master
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

 * cc: Carlton Gibson (added)
 * type:  Uncategorized => New feature
 * stage:  Unreviewed => Accepted


Comment:

 Hi Nicolas. I'm going to Accept this: it seems reasonable.

 > …in cases it would disable colors by default (typically, when the output
 is piped to another command, as documented).

 Can I ask, where is this documented? I cannot seem to find it. Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/29560#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.87643d31b365c86a89f701a89d42e409%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29560: Add an option to django-admin to always colorize output

Django
In reply to this post by Django
#29560: Add an option to django-admin to always colorize output
-------------------------------------+-------------------------------------
     Reporter:  Nicolas Noé          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Core (Management     |                  Version:  master
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Nicolas Noé):

 Thanks Carlton!

 It is documented in https://docs.djangoproject.com/en/2.0/ref/django-admin
 /#syntax-coloring:

 ''The django-admin / manage.py commands will use pretty color-coded output
 if your terminal supports ANSI-colored output. It won’t use the color
 codes if you’re piping the command’s output to another program.''

--
Ticket URL: <https://code.djangoproject.com/ticket/29560#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.716bcd0e6d502f04e45449c162e1b672%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29560: Add an option to django-admin to always colorize output

Django
In reply to this post by Django
#29560: Add an option to django-admin to always colorize output
-------------------------------------+-------------------------------------
     Reporter:  Nicolas Noé          |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Core (Management     |                  Version:  master
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

 Thanks Nicolas. I just found that. (I must have been blind: I even looked
 in that exact location... sigh :-)

--
Ticket URL: <https://code.djangoproject.com/ticket/29560#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.208d97367e3866a3509db43454b43d34%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29560: Add an option to django-admin to always colorize output

Django
In reply to this post by Django
#29560: Add an option to django-admin to always colorize output
-------------------------------------+-------------------------------------
     Reporter:  Nicolas Noé          |                    Owner:  Nicolas
                                     |  Noé
         Type:  New feature          |                   Status:  assigned
    Component:  Core (Management     |                  Version:  master
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Nicolas Noé):

 * owner:  nobody => Nicolas Noé
 * status:  new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/29560#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.528ffa76d39740a1b523424532d09e2f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29560: Add an option to django-admin to always colorize output

Django
In reply to this post by Django
#29560: Add an option to django-admin to always colorize output
-------------------------------------+-------------------------------------
     Reporter:  Nicolas Noé          |                    Owner:  (none)
         Type:  New feature          |                   Status:  new
    Component:  Core (Management     |                  Version:  master
  commands)                          |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Nicolas Noé):

 * status:  assigned => new
 * owner:  Nicolas Noé => (none)


Comment:

 I unfortunately can't find time in the short term to work on the
 implementation...

--
Ticket URL: <https://code.djangoproject.com/ticket/29560#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.91fe05d79b2073d18cf9c028a27f243c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.