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
0a4d13e8
Kaydet (Commit)
0a4d13e8
authored
May 27, 2014
tarafından
Terry Jan Reedy
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #21477: Add htests for Search and Replace dialogs.
Patch by Saimadhav Heblikar.
üst
aa7886dd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
15 deletions
+73
-15
ReplaceDialog.py
Lib/idlelib/ReplaceDialog.py
+31
-0
SearchDialog.py
Lib/idlelib/SearchDialog.py
+22
-0
TreeWidget.py
Lib/idlelib/TreeWidget.py
+0
-9
htest.py
Lib/idlelib/idle_test/htest.py
+20
-6
No files found.
Lib/idlelib/ReplaceDialog.py
Dosyayı görüntüle @
0a4d13e8
...
@@ -188,3 +188,34 @@ class ReplaceDialog(SearchDialogBase):
...
@@ -188,3 +188,34 @@ class ReplaceDialog(SearchDialogBase):
def
close
(
self
,
event
=
None
):
def
close
(
self
,
event
=
None
):
SearchDialogBase
.
close
(
self
,
event
)
SearchDialogBase
.
close
(
self
,
event
)
self
.
text
.
tag_remove
(
"hit"
,
"1.0"
,
"end"
)
self
.
text
.
tag_remove
(
"hit"
,
"1.0"
,
"end"
)
def
_replace_dialog
(
parent
):
root
=
Tk
()
root
.
title
(
"Test ReplaceDialog"
)
width
,
height
,
x
,
y
=
list
(
map
(
int
,
re
.
split
(
'[x+]'
,
parent
.
geometry
())))
root
.
geometry
(
"+
%
d+
%
d"
%
(
x
,
y
+
150
))
# mock undo delegator methods
def
undo_block_start
():
pass
def
undo_block_stop
():
pass
text
=
Text
(
root
)
text
.
undo_block_start
=
undo_block_start
text
.
undo_block_stop
=
undo_block_stop
text
.
pack
()
text
.
insert
(
"insert"
,
"This is a sample string.
\n
"
*
10
)
def
show_replace
():
text
.
tag_add
(
SEL
,
"1.0"
,
END
)
replace
(
text
)
text
.
tag_remove
(
SEL
,
"1.0"
,
END
)
button
=
Button
(
root
,
text
=
"Replace"
,
command
=
show_replace
)
button
.
pack
()
if
__name__
==
'__main__'
:
from
idlelib.idle_test.htest
import
run
run
(
_replace_dialog
)
Lib/idlelib/SearchDialog.py
Dosyayı görüntüle @
0a4d13e8
...
@@ -65,3 +65,25 @@ class SearchDialog(SearchDialogBase):
...
@@ -65,3 +65,25 @@ class SearchDialog(SearchDialogBase):
if
pat
:
if
pat
:
self
.
engine
.
setcookedpat
(
pat
)
self
.
engine
.
setcookedpat
(
pat
)
return
self
.
find_again
(
text
)
return
self
.
find_again
(
text
)
def
_search_dialog
(
parent
):
root
=
Tk
()
root
.
title
(
"Test SearchDialog"
)
width
,
height
,
x
,
y
=
list
(
map
(
int
,
re
.
split
(
'[x+]'
,
parent
.
geometry
())))
root
.
geometry
(
"+
%
d+
%
d"
%
(
x
,
y
+
150
))
text
=
Text
(
root
)
text
.
pack
()
text
.
insert
(
"insert"
,
"This is a sample string.
\n
"
*
10
)
def
show_find
():
text
.
tag_add
(
SEL
,
"1.0"
,
END
)
s
=
_setup
(
text
)
s
.
open
(
text
)
text
.
tag_remove
(
SEL
,
"1.0"
,
END
)
button
=
Button
(
root
,
text
=
"Search"
,
command
=
show_find
)
button
.
pack
()
if
__name__
==
'__main__'
:
from
idlelib.idle_test.htest
import
run
run
(
_search_dialog
)
Lib/idlelib/TreeWidget.py
Dosyayı görüntüle @
0a4d13e8
...
@@ -453,20 +453,11 @@ def _tree_widget(parent):
...
@@ -453,20 +453,11 @@ def _tree_widget(parent):
root
.
title
(
"Test TreeWidget"
)
root
.
title
(
"Test TreeWidget"
)
width
,
height
,
x
,
y
=
list
(
map
(
int
,
re
.
split
(
'[x+]'
,
parent
.
geometry
())))
width
,
height
,
x
,
y
=
list
(
map
(
int
,
re
.
split
(
'[x+]'
,
parent
.
geometry
())))
root
.
geometry
(
"+
%
d+
%
d"
%
(
x
,
y
+
150
))
root
.
geometry
(
"+
%
d+
%
d"
%
(
x
,
y
+
150
))
# test with scrollable canvas
sc
=
ScrolledCanvas
(
root
,
bg
=
"white"
,
highlightthickness
=
0
,
takefocus
=
1
)
sc
=
ScrolledCanvas
(
root
,
bg
=
"white"
,
highlightthickness
=
0
,
takefocus
=
1
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
,
side
=
LEFT
)
sc
.
frame
.
pack
(
expand
=
1
,
fill
=
"both"
,
side
=
LEFT
)
item
=
FileTreeItem
(
os
.
getcwd
())
item
=
FileTreeItem
(
os
.
getcwd
())
node
=
TreeNode
(
sc
.
canvas
,
None
,
item
)
node
=
TreeNode
(
sc
.
canvas
,
None
,
item
)
node
.
expand
()
node
.
expand
()
# test without scrollable canvas
canvas
=
Canvas
(
root
,
bg
=
"white"
,
highlightthickness
=
0
)
canvas
.
pack
(
expand
=
0
,
fill
=
"both"
,
side
=
RIGHT
)
item
=
FileTreeItem
(
os
.
getcwd
())
node
=
TreeNode
(
canvas
,
None
,
item
)
node
.
update
()
root
.
mainloop
()
root
.
mainloop
()
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
Lib/idlelib/idle_test/htest.py
Dosyayı görüntüle @
0a4d13e8
...
@@ -54,9 +54,9 @@ _class_browser_spec = {
...
@@ -54,9 +54,9 @@ _class_browser_spec = {
'kwds'
:
{},
'kwds'
:
{},
'msg'
:
"Inspect names of module, class(with superclass if "
'msg'
:
"Inspect names of module, class(with superclass if "
"applicable), methods and functions.
\n
Toggle nested items.
\n
"
"applicable), methods and functions.
\n
Toggle nested items.
\n
"
"Double clicking on items prints a traceback
print a traceback
"
"Double clicking on items prints a traceback
for an exception
"
"for an exception
that is ignored."
"
that is ignored."
}
}
_color_delegator_spec
=
{
_color_delegator_spec
=
{
'file'
:
'ColorDelegator'
,
'file'
:
'ColorDelegator'
,
...
@@ -181,6 +181,22 @@ _percolator_spec = {
...
@@ -181,6 +181,22 @@ _percolator_spec = {
"Test for actions like text entry, and removal."
"Test for actions like text entry, and removal."
}
}
_replace_dialog_spec
=
{
'file'
:
'ReplaceDialog'
,
'kwds'
:
{},
'msg'
:
"Click the 'Replace' button.
\n
"
"Test various replace options in the 'Replace dialog'.
\n
"
"Click [Close] or [X] to close to the 'Replace Dialog'."
}
_search_dialog_spec
=
{
'file'
:
'SearchDialog'
,
'kwds'
:
{},
'msg'
:
"Click the 'Search' button.
\n
"
"Test various search options in the 'Search dialog'.
\n
"
"Click [Close] or [X] to close to the 'Search Dialog'."
}
_scrolled_list_spec
=
{
_scrolled_list_spec
=
{
'file'
:
'ScrolledList'
,
'file'
:
'ScrolledList'
,
'kwds'
:
{},
'kwds'
:
{},
...
@@ -227,9 +243,7 @@ _tooltip_spec = {
...
@@ -227,9 +243,7 @@ _tooltip_spec = {
_tree_widget_spec
=
{
_tree_widget_spec
=
{
'file'
:
'TreeWidget'
,
'file'
:
'TreeWidget'
,
'kwds'
:
{},
'kwds'
:
{},
'msg'
:
"You should see two canvases side-by-side.
\n
"
'msg'
:
"The canvas is scrollable.
\n
"
"The left canvas is scrollable.
\n
"
"The right canvas is not scrollable.
\n
"
"Click on folders upto to the lowest level."
"Click on folders upto to the lowest level."
}
}
...
...
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