home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Cadre Technologies Inc. 1996
- #
- # File: @(#)clwatchdog.tcl /main/titanic/2
- # Author: <generated>
- # Description:
- #---------------------------------------------------------------------------
- # SccsId = @(#)clwatchdog.tcl /main/titanic/2 23 Oct 1997 Copyright 1996 Cadre Technologies Inc.
-
- # Start user added include file section
- # End user added include file section
-
-
- Class ClWatchdog : {Object} {
- constructor
- method destructor
- method escape
- method execute
- attribute interp
- attribute script
- attribute endScript
- }
-
- constructor ClWatchdog {class this name} {
- set this [Object::constructor $class $this $name]
- # Start constructor user section
- # End constructor user section
- return $this
- }
-
- method ClWatchdog::destructor {this} {
- # Start destructor user section
- # End destructor user section
- }
-
- method ClWatchdog::escape {this cmd} {
- if $win95 {
- return $cmd
- }
-
- set sn $cmd
- if {[regsub -all {\$} $sn {\\$} snn]} {set sn $snn}
- return $sn
- }
-
- method ClWatchdog::execute {this} {
- if {! [isRunning [$this interp] 1]} {
- return 1
- }
-
- send -async [$this interp] {$wmttoolObj watchdogBusy 1}
- set doErrorLater 0
- if [catch {set returnValue [system [$this escape [$this script]]]} msg] {
- set doErrorLater 1
- set returnValue 1
- }
- send [$this interp] \
- [concat {$wmttoolObj exitStatusList} [list $returnValue]]
- if {"[$this endScript]" != ""} {
- send -async [$this interp] [list eval [$this endScript]]
- }
- send -async [$this interp] {$wmttoolObj watchdogBusy 0}
-
- # wmtkerror can exit
- # do it after interp msgs
- if $doErrorLater {
- wmtkerror $msg
- }
-
- $this delete
- return $returnValue
- }
-
- # Do not delete this line -- regeneration end marker
-
-