Changeset 2753


Ignore:
Timestamp:
Jan 6, 2012, 11:43:45 AM (13 years ago)
Author:
gah
Message:
 
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/app-fermi/octave/octave3/tool.xml

    r1633 r2753  
    33    <tool>
    44        <about>Press Simulate to view results.</about>
    5         <command>octave --silent --eval infile='@driver',path('@tool',path),fermi</command>
     5        <command>octave --silent --eval "infile='@driver',path('@tool',path),fermi"</command>
    66    </tool>
    77    <input>
  • trunk/gui/scripts/controlOwner.tcl

    r1929 r2753  
    6666        note contents
    6767        number current
     68        periodicelement current
    6869        string current
    6970    }
  • trunk/gui/scripts/periodictable.tcl

    r2744 r2753  
    460460    set elem [FindElement $name]
    461461    if { $elem == "" || $_state($elem) == "disabled" } {
     462        if { $elem != "" } {
     463            puts stderr "element $elem is disabled"
     464        }
    462465        return ""
    463466    }
     
    607610
    608611# ----------------------------------------------------------------------
    609 # USAGE: select <name>
     612# USAGE: FindElement
    610613#
    611614# Used to manipulate the selection in the table.
     
    614617itcl::body Rappture::PeriodicTable::FindElement { what } {
    615618    foreach name [array names _table] {
     619        array unset info
    616620        array set info $_table($name)
    617621        if { $what == $info(name) || $what == $info(number) ||
    618622             $what == $info(symbol) } {
    619             break
    620         }
    621         array unset info
    622     }
    623     if { [info exists info] } {
    624         return $info(name)
    625     }
     623            return $info(name)
     624        }
     625    }
     626    parray info
    626627    return ""
    627628}
  • trunk/gui/scripts/tool.tcl

    r2744 r2753  
    184184        regsub -all {\\} $cmd {\\\\} cmd
    185185        set cmd [string trimleft $cmd " "]
    186 
     186        if { $cmd == "" } {
     187            puts stderr "cmd is empty"
     188            return [list 1 "Command is empty.\n\nThere is no command specified by\n\n <command>\n </command>\n\nin the tool.xml file."]
     189        }
    187190        # if job_protocol is "submit", then use use submit command
    188191        if {[resources -jobprotocol] == "submit"} {
     
    197200            set job(output) [string range $cmd 5 end]
    198201        } else {
    199             set status [catch {eval blt::bgexec \
    200                 ::Rappture::Tool::job(control) \
    201                 -keepnewline yes \
    202                 -killsignal SIGTERM \
    203                 -onoutput [list [itcl::code $this _output]] \
    204                 -output ::Rappture::Tool::job(output) \
    205                 -error ::Rappture::Tool::job(error) $cmd} result]
     202            set status [catch {
     203                eval blt::bgexec \
     204                    ::Rappture::Tool::job(control) \
     205                    -keepnewline yes \
     206                    -killsignal SIGTERM \
     207                    -onoutput [list [itcl::code $this _output]] \
     208                    -output ::Rappture::Tool::job(output) \
     209                    -error ::Rappture::Tool::job(error) \
     210                    $cmd
     211            } result]
    206212
    207213            if { $status != 0 } {
    208                 foreach {code pid mesg} $::Rappture::Tool::job(control) break
    209                 if { $code != "EXITED" } {
    210                     set result "Abnormal program termination \"$code\": $mesg"
    211                     return [list $status $result]
    212                 }
     214                if { $::Rappture::Tool::job(control) != "" } {
     215                    set code [lindex $::Rappture::Tool::job(control) 0]
     216                    set mesg [lindex $::Rappture::Tool::job(control) 2]
     217                    if { $code != "EXITED" } {
     218                        set result \
     219                            "Abnormal program termination \"$code\": $mesg"
     220                    }
     221                }
     222                return [list $status $result]
    213223            }
    214224        }
Note: See TracChangeset for help on using the changeset viewer.