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
88fbcf82
Kaydet (Commit)
88fbcf82
authored
Ock 20, 2008
tarafından
Andrew M. Kuchling
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add an interactive test script for exercising curses
üst
4a2762d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
curses_tests.py
Lib/test/curses_tests.py
+46
-0
No files found.
Lib/test/curses_tests.py
0 → 100644
Dosyayı görüntüle @
88fbcf82
#!/usr/bin/env python
#
# $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $
#
# Interactive test suite for the curses module.
# This script displays various things and the user should verify whether
# they display correctly.
#
import
curses
from
curses
import
textpad
def
test_textpad
(
stdscr
,
insert_mode
=
False
):
ncols
,
nlines
=
8
,
3
uly
,
ulx
=
3
,
2
if
insert_mode
:
mode
=
'insert mode'
else
:
mode
=
'overwrite mode'
stdscr
.
addstr
(
uly
-
3
,
ulx
,
"Use Ctrl-G to end editing (
%
s)."
%
mode
)
stdscr
.
addstr
(
uly
-
2
,
ulx
,
"Be sure to try typing in the lower-right corner."
)
win
=
curses
.
newwin
(
nlines
,
ncols
,
uly
,
ulx
)
textpad
.
rectangle
(
stdscr
,
uly
-
1
,
ulx
-
1
,
uly
+
nlines
,
ulx
+
ncols
)
stdscr
.
refresh
()
box
=
textpad
.
Textbox
(
win
,
insert_mode
)
contents
=
box
.
edit
()
stdscr
.
addstr
(
uly
+
ncols
+
2
,
0
,
"Text entered in the box
\n
"
)
stdscr
.
addstr
(
repr
(
contents
))
stdscr
.
addstr
(
'
\n
'
)
stdscr
.
addstr
(
'Press any key'
)
stdscr
.
getch
()
for
i
in
range
(
3
):
stdscr
.
move
(
uly
+
ncols
+
2
+
i
,
0
)
stdscr
.
clrtoeol
()
def
main
(
stdscr
):
stdscr
.
clear
()
test_textpad
(
stdscr
,
False
)
test_textpad
(
stdscr
,
True
)
if
__name__
==
'__main__'
:
curses
.
wrapper
(
main
)
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