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
d2bc389e
Kaydet (Commit)
d2bc389e
authored
Nis 15, 2015
tarafından
Steve Dower
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari
üst
9abe0497
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
0 deletions
+31
-0
curses.rst
Doc/library/curses.rst
+7
-0
3.5.rst
Doc/whatsnew/3.5.rst
+5
-0
test_curses.py
Lib/test/test_curses.py
+7
-0
NEWS
Misc/NEWS
+2
-0
_cursesmodule.c
Modules/_cursesmodule.c
+10
-0
No files found.
Doc/library/curses.rst
Dosyayı görüntüle @
d2bc389e
...
@@ -599,6 +599,13 @@ The module :mod:`curses` defines the following functions:
...
@@ -599,6 +599,13 @@ The module :mod:`curses` defines the following functions:
Only one *ch* can be pushed before :meth:`getch` is called.
Only one *ch* can be pushed before :meth:`getch` is called.
.. function:: update_lines_cols()
Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual screen resize.
.. versionadded:: 3.5
.. function:: unget_wch(ch)
.. function:: unget_wch(ch)
Push *ch* so the next :meth:`get_wch` will return it.
Push *ch* so the next :meth:`get_wch` will return it.
...
...
Doc/whatsnew/3.5.rst
Dosyayı görüntüle @
d2bc389e
...
@@ -289,6 +289,11 @@ contextlib
...
@@ -289,6 +289,11 @@ contextlib
don't provide any options to redirect it.
don't provide any options to redirect it.
(Contributed by Berker Peksag in :issue:`22389`.)
(Contributed by Berker Peksag in :issue:`22389`.)
curses
------
* The new :func:`curses.update_lines_cols` function updates the variables
:envvar:`curses.LINES` and :envvar:`curses.COLS`.
difflib
difflib
-------
-------
...
...
Lib/test/test_curses.py
Dosyayı görüntüle @
d2bc389e
...
@@ -370,6 +370,13 @@ class TestCurses(unittest.TestCase):
...
@@ -370,6 +370,13 @@ class TestCurses(unittest.TestCase):
offset
=
human_readable_signature
.
find
(
"[y, x,]"
)
offset
=
human_readable_signature
.
find
(
"[y, x,]"
)
assert
offset
>=
0
,
""
assert
offset
>=
0
,
""
def
test_update_lines_cols
(
self
):
# this doesn't actually test that LINES and COLS are updated,
# because we can't automate changing them. See Issue #4254 for
# a manual test script. We can only test that the function
# can be called.
curses
.
update_lines_cols
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
Misc/NEWS
Dosyayı görüntüle @
d2bc389e
...
@@ -36,6 +36,8 @@ Core and Builtins
...
@@ -36,6 +36,8 @@ Core and Builtins
Library
Library
-------
-------
- Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari
- Issue 19933: Provide default argument for ndigits in round. Patch by
- Issue 19933: Provide default argument for ndigits in round. Patch by
Vajrasky Kok.
Vajrasky Kok.
...
...
Modules/_cursesmodule.c
Dosyayı görüntüle @
d2bc389e
...
@@ -2866,6 +2866,13 @@ update_lines_cols(void)
...
@@ -2866,6 +2866,13 @@ update_lines_cols(void)
Py_DECREF
(
m
);
Py_DECREF
(
m
);
return
1
;
return
1
;
}
}
static
PyObject
*
PyCurses_update_lines_cols
(
PyObject
*
self
)
{
return
PyLong_FromLong
((
long
)
update_lines_cols
());
}
#endif
#endif
#ifdef HAVE_CURSES_RESIZETERM
#ifdef HAVE_CURSES_RESIZETERM
...
@@ -3268,6 +3275,9 @@ static PyMethodDef PyCurses_methods[] = {
...
@@ -3268,6 +3275,9 @@ static PyMethodDef PyCurses_methods[] = {
{
"typeahead"
,
(
PyCFunction
)
PyCurses_TypeAhead
,
METH_VARARGS
},
{
"typeahead"
,
(
PyCFunction
)
PyCurses_TypeAhead
,
METH_VARARGS
},
{
"unctrl"
,
(
PyCFunction
)
PyCurses_UnCtrl
,
METH_VARARGS
},
{
"unctrl"
,
(
PyCFunction
)
PyCurses_UnCtrl
,
METH_VARARGS
},
{
"ungetch"
,
(
PyCFunction
)
PyCurses_UngetCh
,
METH_VARARGS
},
{
"ungetch"
,
(
PyCFunction
)
PyCurses_UngetCh
,
METH_VARARGS
},
#if defined(HAVE_CURSES_RESIZETERM) || defined(HAVE_CURSES_RESIZE_TERM)
{
"update_lines_cols"
,
(
PyCFunction
)
PyCurses_update_lines_cols
,
METH_NOARGS
},
#endif
#ifdef HAVE_NCURSESW
#ifdef HAVE_NCURSESW
{
"unget_wch"
,
(
PyCFunction
)
PyCurses_Unget_Wch
,
METH_VARARGS
},
{
"unget_wch"
,
(
PyCFunction
)
PyCurses_Unget_Wch
,
METH_VARARGS
},
#endif
#endif
...
...
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