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
84718156
Commit
84718156
authored
Feb 06, 2015
by
Dagobert Michelsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use termios instead of stty for compatibility
parent
23a2e52c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
bin/ansible-doc
+6
-1
No files found.
bin/ansible-doc
View file @
84718156
...
...
@@ -25,6 +25,10 @@ import re
import
optparse
import
datetime
import
subprocess
import
fcntl
import
termios
import
struct
from
ansible
import
utils
from
ansible.utils
import
module_docs
import
ansible.constants
as
C
...
...
@@ -167,7 +171,8 @@ def get_snippet_text(doc):
def
get_module_list_text
(
module_list
):
tty_size
=
0
if
os
.
isatty
(
0
):
tty_size
=
int
(
os
.
popen
(
'stty size'
,
'r'
)
.
read
()
.
split
()[
1
])
tty_size
=
struct
.
unpack
(
'HHHH'
,
fcntl
.
ioctl
(
0
,
termios
.
TIOCGWINSZ
,
struct
.
pack
(
'HHHH'
,
0
,
0
,
0
,
0
)))[
1
]
columns
=
max
(
60
,
tty_size
)
displace
=
max
(
len
(
x
)
for
x
in
module_list
)
linelimit
=
columns
-
displace
-
5
...
...
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