Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Only colourise synctl output when attached to tty #4049

Merged
merged 3 commits into from
Oct 18, 2018

Conversation

erikjohnston
Copy link
Member

We should probably not be hand rolling this, but I don't want to get lost in a rabbithole of replacing with a proper library.

synctl Outdated
if colour == NORMAL:
# Lets check if we're writing to a TTY before colouring
should_colour = False
if stream in (sys.stdout, sys.stderr):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you just catch the AttributeError instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and maybe not even bother checking if colour==NORMAL)

@erikjohnston erikjohnston merged commit e77f24d into develop Oct 18, 2018
@erikjohnston erikjohnston deleted the erikj/synctl_colour branch December 12, 2018 15:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants