-from distutils.command.build_ext import build_ext
-from distutils.errors import CCompilerError, DistutilsPlatformError
-
-
-def list_files(path):
- for fn in os.listdir(path):
- if fn.startswith('.'):
- continue
- fn = os.path.join(path, fn)
- if os.path.isfile(fn):
- yield fn
-
-
-def get_terminal_width():
- """Return the current terminal dimensions."""
- try:
- from struct import pack, unpack
- from fcntl import ioctl
- from termios import TIOCGWINSZ
- s = pack('HHHH', 0, 0, 0, 0)
- return unpack('HHHH', ioctl(sys.stdout.fileno(), TIOCGWINSZ, s))[1]
- except:
- return 80