Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

1.44pre4

  • Loading branch information...
commit c0083710f8607b4aa14a0d6685ce3a60a45c4603 1 parent 6c7f3fd
Ulf Betlehem authored holizz committed
Showing with 9 additions and 12 deletions.
  1. +9 −12 cplay
View
21 cplay
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- python -*-
-__version__ = "cplay 1.44pre3"
+__version__ = "cplay 1.44pre4"
"""
cplay - A curses front-end for various audio players
@@ -37,11 +37,8 @@ import re
try: from ncurses import curses
except ImportError: import curses
-try: import termios
-except ImportError: termios = None
-
-try: import TERMIOS
-except ImportError: TERMIOS = termios
+try: import tty
+except ImportError: tty = None
try: import locale; locale.setlocale(locale.LC_ALL, "")
except: pass
@@ -1129,11 +1126,11 @@ class Application:
self.keymapstack = KeymapStack()
def setup(self):
- if termios:
- self.tcattr = termios.tcgetattr(sys.stdin.fileno())
- tcattr = termios.tcgetattr(sys.stdin.fileno())
- tcattr[0] = tcattr[0] & ~(TERMIOS.IXON)
- termios.tcsetattr(sys.stdin.fileno(), TERMIOS.TCSANOW, tcattr)
+ if tty:
+ self.tcattr = tty.tcgetattr(sys.stdin.fileno())
+ tcattr = tty.tcgetattr(sys.stdin.fileno())
+ tcattr[0] = tcattr[0] & ~(tty.IXON)
+ tty.tcsetattr(sys.stdin.fileno(), tty.TCSANOW, tcattr)
self.w = curses.initscr()
curses.cbreak()
curses.noecho()
@@ -1166,7 +1163,7 @@ class Application:
def cleanup(self):
curses.endwin()
XTERM and sys.stderr.write("\033]0;%s\a" % "xterm")
- termios and termios.tcsetattr(sys.stdin.fileno(), TERMIOS.TCSADRAIN, self.tcattr)
+ tty and tty.tcsetattr(sys.stdin.fileno(), tty.TCSADRAIN, self.tcattr)
def run(self):
while 1:
Please sign in to comment.
Something went wrong with that request. Please try again.