eRSrSSKJr "SS5r\S:XaSSKJr \"SSS S 9 g g ) z9Implement Idle Shell history mechanism with History class)idleConfc6\rSrSrSrSrSrSrSrSr Sr g ) Historya+Implement Idle Shell history mechanism. store - Store source statement (called from pyshell.resetoutput). fetch - Fetch stored statement matching prefix already entered. history_next - Bound to <> event (default Alt-N). history_prev - Bound to <> event (default Alt-P). cXl/UlSUlSUl[R "SSSSS5UlURSUR5 URSUR5 g) a4Initialize data attributes and bind event methods. .text - Idle wrapper of tk Text widget, with .bell(). .history - source statements, possibly with multiple lines. .prefix - source already entered at prompt; filters history list. .pointer - index into history. .cyclic - wrap around history list (or not). Nmainrcyclicboolz<>z<>) texthistoryprefixpointerr GetOptionr bind history_prev history_next)selfr s 5/opt/imh/python3.13/lib/python3.13/idlelib/history.py__init__History.__init__sb    ((HaP  ($*;*;< $d&7&78c"URSS9 g)z5Fetch later statement; start with earliest if cyclic.Freversebreakfetchrevents rrHistory.history_nexts 5 !rc"URSS9 g)z0Fetch earlier statement; start with most recent.Trrrrs rrHistory.history_prev$s 4  rc[UR5nURnURnUbqUbnURR SSS5(d-URR SS5URU:waS=p4URRSS5 UbUcUURR SS5nU(aUnO/UR(aSnOURR5 g[U5nX1(aSOS- nUS:dX2:aURR5 UR(dUS:agURR SS5U:wa9URRSS5 URRSUS 5 S=p4OdURUnUSUU:XaI[U5U:a:URRSS5 URRSUS 5 OGM URRS5 URRS S S 5 X0lX@lg) aFetch statement and replace current line in text widget. Set prefix and pointer as needed for successive fetches. Reset them to None, None when returning to the start line. Sound bell when return to start line or cannot leave a line because cyclic is False. Ninsertz!=zend-1ciomarkr rstdinselz1.0end)lenr rrr comparegetmark_setr belldeleter%see tag_remove)rrnhistrrnprefixitems rr History.fetch)sDLL!,,  6#5yy  4::IIMM(H5g9NN#'' ""8X6 ?fnYY]]8X6F;; GIINN$f+ Wr! +G{g.  {{w{yy}}Xx8FB ((8< ((67C'++G<<(DHW~'CI,?   84   49!" h UE51  rcUR5n[U5S:a7URRU5 URR U5 SUlSUlg![a N6f=f)z.Store Shell input statement into history list.N)stripr+r remove ValueErrorappendrr)rsources rstore History.storeZse v;?  ##F+ LL   '    sA&& A32A3)r r rrr N) __name__ __module__ __qualname____firstlineno____doc__rrrrr>__static_attributes__rrrrs!9"  /b rr__main__)rzidlelib.idle_test.test_historyr8F) verbosityexitN)rDidlelib.configrrr@unittestrrFrrrLs7;#__D z )QUCr