~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Modules/_cursesmodule.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-03-11 13:30:19 UTC
  • mto: (10.1.13 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: james.westby@ubuntu.com-20100311133019-sblbooa3uqrkoe70
Tags: upstream-2.6.5~rc2
ImportĀ upstreamĀ versionĀ 2.6.5~rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 *   PERFORMANCE OF THIS SOFTWARE.
32
32
 */
33
33
 
34
 
/* CVS: $Id: _cursesmodule.c 64406 2008-06-19 14:02:30Z andrew.kuchling $ */
 
34
/* CVS: $Id: _cursesmodule.c 78324 2010-02-22 17:06:22Z andrew.kuchling $ */
35
35
 
36
36
/*
37
37
 
882
882
    /* getch() returns ERR in nodelay mode */
883
883
    PyErr_SetString(PyCursesError, "no input");
884
884
    return NULL;
885
 
  } else if (rtn<=255)
 
885
  } else if (rtn<=255) {
886
886
    return Py_BuildValue("c", rtn);
887
 
  else
 
887
  } else {
 
888
    const char *knp;
888
889
#if defined(__NetBSD__)
889
 
    return PyString_FromString(unctrl(rtn));
 
890
    knp = unctrl(rtn);
890
891
#else
891
 
    return PyString_FromString((char *)keyname(rtn));
 
892
    knp = keyname(rtn);
892
893
#endif
 
894
    return PyString_FromString((knp == NULL) ? "" : knp);
 
895
  }
893
896
}
894
897
 
895
898
static PyObject *
2586
2589
{
2587
2590
  int flag;
2588
2591
 
2589
 
  PyCursesInitialised
2590
 
 
2591
2592
  switch(PyTuple_Size(args)) {
2592
2593
  case 1:
2593
2594
    if (!PyArg_ParseTuple(args,"i;True(1), False(0)",&flag))