[GRASS-dev] gis.m: last line duplicated in the Output panel

When running "any" commands from gis.m, I get duplicated last lines in
the Output window. In lib/gtcltk/gronsole.tcl,

proc Gronsole::readout {path ci mark fh} {

        set lines {}

        while {[gets $fh line] >= 0} {
                lappend lines $line
        }

        if {[llength $lines] != 0} {
                Gronsole::add_data_tag $path $ci out
        }
        foreach line $lines {
                Gronsole::output_to_gronsole $path $mark $ci [list cmd$ci cmd$ci-out] "$line\n"
        }
        set last [lindex $lines end]
        if {$last != {}} {
                Gronsole::output_to_gronsole $path $mark $ci [list cmd$ci cmd$ci-out] $last
        }

The above if clause unnecessarily outputs the last line *again* after all the
output is sent to gronsole. Do we need to omit the newline from the last line?

Huidae Cho

Will it work if you just take out the last line display clause? (beginning
with set last [lindex...).

Michael

On 5/14/07 7:29 PM, "Huidae Cho" <grass4u@gmail.com> wrote:

When running "any" commands from gis.m, I get duplicated last lines in
the Output window. In lib/gtcltk/gronsole.tcl,

proc Gronsole::readout {path ci mark fh} {

        set lines {}

        while {[gets $fh line] >= 0} {
                lappend lines $line
        }

        if {[llength $lines] != 0} {
                Gronsole::add_data_tag $path $ci out
        }
        foreach line $lines {
                Gronsole::output_to_gronsole $path $mark $ci [list cmd$ci
cmd$ci-out] "$line\n"
        }
        set last [lindex $lines end]
        if {$last != {}} {
                Gronsole::output_to_gronsole $path $mark $ci [list cmd$ci
cmd$ci-out] $last
        }

The above if clause unnecessarily outputs the last line *again* after all the
output is sent to gronsole. Do we need to omit the newline from the last
line?

Huidae Cho

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Yes, that will work for me.

Huidae Cho

On Mon, May 14, 2007 at 09:57:15PM -0700, Michael Barton wrote:

Will it work if you just take out the last line display clause? (beginning
with set last [lindex...).

Michael

On 5/14/07 7:29 PM, "Huidae Cho" <grass4u@gmail.com> wrote:

> When running "any" commands from gis.m, I get duplicated last lines in
> the Output window. In lib/gtcltk/gronsole.tcl,
>
> proc Gronsole::readout {path ci mark fh} {
>
> set lines {}
>
> while {[gets $fh line] >= 0} {
> lappend lines $line
> }
>
> if {[llength $lines] != 0} {
> Gronsole::add_data_tag $path $ci out
> }
> foreach line $lines {
> Gronsole::output_to_gronsole $path $mark $ci [list cmd$ci
> cmd$ci-out] "$line\n"
> }
> set last [lindex $lines end]
> if {$last != {}} {
> Gronsole::output_to_gronsole $path $mark $ci [list cmd$ci
> cmd$ci-out] $last
> }
>
> The above if clause unnecessarily outputs the last line *again* after all the
> output is sent to gronsole. Do we need to omit the newline from the last
> line?
>
>
> Huidae Cho
>
>

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton