Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f16e0ed7
Kaydet (Commit)
f16e0ed7
authored
Kas 07, 2000
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #102278: add tparm() function to _curses module
üst
a776cea7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
4 deletions
+62
-4
libcurses.tex
Doc/lib/libcurses.tex
+7
-0
_cursesmodule.c
Modules/_cursesmodule.c
+55
-4
No files found.
Doc/lib/libcurses.tex
Dosyayı görüntüle @
f16e0ed7
...
...
@@ -466,6 +466,13 @@ terminfo capability name \var{capname}. \code{None} is returned if
from the terminal description.
\end{funcdesc}
\begin{funcdesc}
{
tparm
}{
str
\optional
{
,...
}}
Instantiates the string
\var
{
str
}
with the supplied parameters, where
\var
{
str
}
should be a parameterized string obtained from the terminfo
database. E.g.
\code
{
tparm(tigetstr("cup"),5,3)
}
could result in
\code
{
"
\e
{}
033[6;4H"
}
, the exact result depending on terminal type.
\end{funcdesc}
\begin{funcdesc}
{
typeahead
}{
fd
}
Specifies that the file descriptor
\var
{
fd
}
be used for typeahead
checking. If
\var
{
fd
}
is -1, then no typeahead checking is done.
...
...
Modules/_cursesmodule.c
Dosyayı görüntüle @
f16e0ed7
...
...
@@ -47,10 +47,9 @@ unsupported functions:
overlay overwrite resetty resizeterm restartterm ripoffline
savetty scr_dump scr_init scr_restore scr_set scrl set_curterm
set_term setterm setupterm tgetent tgetflag tgetnum tgetstr
tgoto timeout tparm tputs tputs typeahead use_default_colors
vidattr vidputs waddchnstr waddchstr wchgat wcolor_set
winchnstr winchstr winnstr wmouse_trafo wredrawln wscrl
wtimeout
tgoto timeout tputs typeahead use_default_colors vidattr
vidputs waddchnstr waddchstr wchgat wcolor_set winchnstr
winchstr winnstr wmouse_trafo wredrawln wscrl wtimeout
Low-priority:
slk_attr slk_attr_off slk_attr_on slk_attr_set slk_attroff
...
...
@@ -2097,6 +2096,57 @@ PyCurses_tigetstr(PyObject *self, PyObject *args)
return
PyString_FromString
(
capname
);
}
static
PyObject
*
PyCurses_tparm
(
PyObject
*
self
,
PyObject
*
args
)
{
char
*
fmt
;
char
*
result
=
NULL
;
int
i1
,
i2
,
i3
,
i4
,
i5
,
i6
,
i7
,
i8
,
i9
;
PyCursesInitialised
;
if
(
!
PyArg_ParseTuple
(
args
,
"s|iiiiiiiii:tparm"
,
&
fmt
,
&
i1
,
&
i2
,
&
i3
,
&
i4
,
&
i5
,
&
i6
,
&
i7
,
&
i8
,
&
i9
))
{
return
NULL
;
}
switch
(
PyTuple_GET_SIZE
(
args
))
{
case
1
:
result
=
tparm
(
fmt
);
break
;
case
2
:
result
=
tparm
(
fmt
,
i1
);
break
;
case
3
:
result
=
tparm
(
fmt
,
i1
,
i2
);
break
;
case
4
:
result
=
tparm
(
fmt
,
i1
,
i2
,
i3
);
break
;
case
5
:
result
=
tparm
(
fmt
,
i1
,
i2
,
i3
,
i4
);
break
;
case
6
:
result
=
tparm
(
fmt
,
i1
,
i2
,
i3
,
i4
,
i5
);
break
;
case
7
:
result
=
tparm
(
fmt
,
i1
,
i2
,
i3
,
i4
,
i5
,
i6
);
break
;
case
8
:
result
=
tparm
(
fmt
,
i1
,
i2
,
i3
,
i4
,
i5
,
i6
,
i7
);
break
;
case
9
:
result
=
tparm
(
fmt
,
i1
,
i2
,
i3
,
i4
,
i5
,
i6
,
i7
,
i8
);
break
;
case
10
:
result
=
tparm
(
fmt
,
i1
,
i2
,
i3
,
i4
,
i5
,
i6
,
i7
,
i8
,
i9
);
break
;
}
return
PyString_FromString
(
result
);
}
static
PyObject
*
PyCurses_TypeAhead
(
PyObject
*
self
,
PyObject
*
args
)
{
...
...
@@ -2246,6 +2296,7 @@ static PyMethodDef PyCurses_methods[] = {
{
"tigetflag"
,
(
PyCFunction
)
PyCurses_tigetflag
,
METH_VARARGS
},
{
"tigetnum"
,
(
PyCFunction
)
PyCurses_tigetnum
,
METH_VARARGS
},
{
"tigetstr"
,
(
PyCFunction
)
PyCurses_tigetstr
,
METH_VARARGS
},
{
"tparm"
,
(
PyCFunction
)
PyCurses_tparm
,
METH_VARARGS
},
{
"typeahead"
,
(
PyCFunction
)
PyCurses_TypeAhead
},
{
"unctrl"
,
(
PyCFunction
)
PyCurses_UnCtrl
},
{
"ungetch"
,
(
PyCFunction
)
PyCurses_UngetCh
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment