Last change
on this file was
150,
checked in by ajj, 16 years ago
|
Moving icpgui to icpgui-test
|
-
Property svn:executable set to
*
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/usr/bin/expectk |
---|
2 | |
---|
3 | log_user 0 |
---|
4 | eval spawn -noecho "/usr/local/icp/bin/icp" |
---|
5 | set icpid $spawn_id |
---|
6 | text .icp |
---|
7 | text .out |
---|
8 | entry .input -relief sunken -bd 1 |
---|
9 | button .howlongbut -text "Howlong i1-6" -command {exp_send -i $icpid "howlong i1-6\r"} |
---|
10 | |
---|
11 | pack .icp -fill x -anchor nw -expand true |
---|
12 | pack .input -fill x |
---|
13 | pack .howlongbut |
---|
14 | pack .out -fill x -anchor nw -expand true |
---|
15 | |
---|
16 | |
---|
17 | expect_background { |
---|
18 | -i $icpid -re "( I \[^\r]+)\r\n" { |
---|
19 | #regexp {.+\:.+([0-9].+) Mins.+\=.+([0-9].+\.[0-9].+) Hrs.*} $expect_out(1,string) ignore indiv total |
---|
20 | regexp ".+(\[0-9]+).+(\[0-9]+).+Mins.+(\[0-9]+\.\[0-9]+).+Hrs.*" $expect_out(1,string) ignore ibuf indiv total |
---|
21 | .out insert end "Howlong = $indiv / $total \n" |
---|
22 | .icp insert end $expect_out(1,string) |
---|
23 | .icp insert end "\n" |
---|
24 | } |
---|
25 | -i $icpid -re "\[^\x0d]+" { |
---|
26 | .icp insert end $expect_out(0,string) |
---|
27 | } |
---|
28 | -i $any_spawn_id "\x0d" { |
---|
29 | } |
---|
30 | -i $any_spawn_id "exit" { exit 0 } |
---|
31 | } |
---|
32 | |
---|
33 | foreach event {<KeyPress> <<PasteSelection>>} {bind .icp $event break; bind .out $event break} |
---|
34 | bind .input <Any-Enter> {focus %W} |
---|
35 | bind .input <Key-Return> {exp_send -i $icpid [ .input get]; exp_send -i $icpid "\r"; .input delete 0 end } |
---|
Note: See
TracBrowser
for help on using the repository browser.