Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
98483f52
Commit
98483f52
authored
Aug 24, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #942 from dagwieers/color-capability
Check for terminal capabilities if curses is available
parents
9fa014f7
47f3be3d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletions
+13
-1
lib/ansible/color.py
+13
-1
No files found.
lib/ansible/color.py
View file @
98483f52
...
...
@@ -21,7 +21,19 @@ import sys
ANSIBLE_COLOR
=
True
if
os
.
getenv
(
"ANSIBLE_NOCOLOR"
)
is
not
None
:
ANSIBLE_COLOR
=
False
if
not
sys
.
stdout
.
isatty
():
elif
not
sys
.
stdout
.
isatty
():
ANSIBLE_COLOR
=
False
else
:
try
:
import
curses
curses
.
setupterm
()
if
curses
.
tigetnum
(
'colors'
)
<
0
:
ANSIBLE_COLOR
=
False
except
ImportError
:
# curses library was not found
pass
except
curses
.
error
:
# curses returns an error (e.g. could not find terminal)
ANSIBLE_COLOR
=
False
# --- begin "pretty"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment