Deleted Added
sdiff udiff text old ( 12882:dd87d7f2f3e5 ) new ( 13788:becab13ee708 )
full compact
1# Copyright (c) 2011 Advanced Micro Devices, Inc.
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 92 unchanged lines hidden (view full) ---

101 elif use_colors is None:
102 # option unspecified; default behavior is to use colors iff isatty
103 return tty_termcap
104 else:
105 return no_termcap
106
107def terminal_size():
108 '''Return the (width, heigth) of the terminal screen.'''
109 h, w, hp, wp = struct.unpack('HHHH',
110 fcntl.ioctl(0, termios.TIOCGWINSZ,
111 struct.pack('HHHH', 0, 0, 0, 0)))
112 return w, h
113
114def separator(char=default_separator, color=None):
115 '''
116 Return a separator of the given character that is the length of the full
117 width of the terminal screen.
118 '''
119 (w, h) = terminal_size()
120 if color:
121 return color + char*w + termcap.Normal

--- 44 unchanged lines hidden ---