This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Overview

The term package is an enhanced version of the standard library’s tty module. It provides context managers for temporarily switching the terminal to raw or cbreak mode and allows to retrieve the cursor position without having to resort to curses.

Package Contents

setraw(fd, when=TCSAFLUSH, min=1, time=0)
Put the terminal in raw mode.
setcbreak(fd, when=TCSAFLUSH, min=1, time=0)
Put the terminal in cbreak mode.
rawmode(fd, when=TCSAFLUSH, min=1, time=0)
Context manager to put the terminal in raw mode.
cbreakmode(fd, when=TCSAFLUSH, min=1, time=0)
Context manager to put the terminal in cbreak mode.
opentty(bufsize=1)
Context manager returning an rw stream connected to /dev/tty. The stream is None if the device could not be opened.
getyx()
Return the cursor position as 1-based (line, col) tuple. Line and col are 0 if the terminal does not support DSR 6.

Examples

from term import getyx

print 'The cursor is in line %d column %d' % getyx()

You may also want to look at the source code of getyx.

Caveat

The terminal must be in canonical mode before any of the functions and context managers can be used. They are not meant for switching between, say, raw and cbreak modes. Nesting context managers of the same type is ok though.

Changelog

2.1 - 2014-04-19

  • Remove setuptools from install_requires because it isn’t. [stefan]

2.0 - 2012-04-27

  • Open /dev/tty in binary mode under Python 3. [stefan]
  • Disable buffering if the device is not seekable. [stefan]
  • Remove getmaxyx since it cannot be implemented reliably. [stefan]
  • Support Python 2.5. [stefan]
  • Change license to GPL or PSF to avoid relicensing of PSF code. [stefan]

1.0 - 2012-04-11

  • Initial release. [stefan]
Release History

Release History

2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
term-2.1.zip (14.7 kB) Copy SHA256 Checksum SHA256 Source Apr 19, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting