parent
6efcf5ca2d
commit
45da9ec01e
|
@ -121,7 +121,8 @@ class IperlMini(mode.Fundamental):
|
||||||
self.hindex = 0
|
self.hindex = 0
|
||||||
|
|
||||||
cmd = ('iperl', '-p')
|
cmd = ('iperl', '-p')
|
||||||
self.pipe = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT)
|
f = open('/dev/null', 'w')
|
||||||
|
self.pipe = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=f)
|
||||||
(type_, value) = self._readline()
|
(type_, value) = self._readline()
|
||||||
assert type_ == 'PROMPT', type_
|
assert type_ == 'PROMPT', type_
|
||||||
w.application.set_mini_buffer_prompt('%s ' % value.strip())
|
w.application.set_mini_buffer_prompt('%s ' % value.strip())
|
||||||
|
|
|
@ -257,12 +257,14 @@ sub main {
|
||||||
$prompt = "..>";
|
$prompt = "..>";
|
||||||
} else {
|
} else {
|
||||||
$input .= $line;
|
$input .= $line;
|
||||||
my @results = map { chomp($_); repr($_); } eval($input);
|
my @results = eval($input);
|
||||||
if($@) {
|
if($@) {
|
||||||
draw_error($@);
|
draw_error($@);
|
||||||
} elsif(scalar(@results) < 2) {
|
} elsif(scalar(@results) < 2) {
|
||||||
|
@results = map { chomp($_); repr($_); }
|
||||||
draw_result($results[0]);
|
draw_result($results[0]);
|
||||||
} else {
|
} else {
|
||||||
|
@results = map { chomp($_); repr($_); }
|
||||||
draw_result(join(", ", @results));
|
draw_result(join(", ", @results));
|
||||||
}
|
}
|
||||||
($input, $prompt) = ("", ">>>");
|
($input, $prompt) = ("", ">>>");
|
||||||
|
|
Loading…
Reference in New Issue