non_tty.py 418 B

12345678910111213141516
  1. import sys
  2. from types import SimpleNamespace
  3. def get_from(parent):
  4. def cols():
  5. return sys.maxsize # do not truncate when there's no tty.
  6. from .void import clear_end_line, clear_end_screen, clear_line # noqa
  7. from .void import factory_cursor_up, hide_cursor, show_cursor # noqa
  8. flush = parent.flush
  9. write = parent.write
  10. carriage_return = ''
  11. return SimpleNamespace(**locals())