~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-11-04 20:37:53 UTC
  • mfrom: (0.16.104 shelf-ui)
  • Revision ID: pqm@pqm.ubuntu.com-20081104203753-tr3wp885v5p7ccpc
Implement shelve and unshelve (abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1616
1616
            raise errors.NoSuchFile(f)
1617
1617
        raise
1618
1618
 
1619
 
 
 
1619
if sys.platform == "win32":
 
1620
    import msvcrt
 
1621
    def getchar():
 
1622
        return msvcrt.getch()
 
1623
else:
 
1624
    import tty
 
1625
    import termios
 
1626
    def getchar():
 
1627
        fd = sys.stdin.fileno()
 
1628
        settings = termios.tcgetattr(fd)
 
1629
        try:
 
1630
            tty.setraw(fd)
 
1631
            ch = sys.stdin.read(1)
 
1632
        finally:
 
1633
            termios.tcsetattr(fd, termios.TCSADRAIN, settings)
 
1634
        return ch