'Returns true if the backend is usable ie Curses works.'

def isusable(s):

    if ((not sys.stdout.isatty()) and sys.stdin.isatty()):
        return False
    if (not os.environ.get('TERM', None)):
        return False
    if ((sys.version_info[0:3] < (2, 6)) or (sys.version_info[0:3] >= (2, 6, 6))):
        try:
            curses.initscr()
            curses.endwin()
        except:
            return False
    return True
