Changeset 5586
- Timestamp:
- Jul 26, 2009, 1:04:34 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/media/tcl/init.tcl
r5585 r5586 93 93 94 94 set filepath [info script] 95 set ::orxonox::mediapath [string range $filepath 0 [string last "/" $filepath]] 95 #set ::orxonox::mediapath [string range $filepath 0 [string last "/" $filepath]] 96 set ::orxonox::mediapath [file dirname $filepath] 96 97 if {[lsearch $auto_path $::orxonox::mediapath] == -1} { 97 98 lappend auto_path $::orxonox::mediapath 98 99 } 99 100 unset filepath 101 102 103 # save the start directory and the library directory 104 105 proc psd {} "return [pwd]" 106 proc pld {} "return $::orxonox::mediapath" 107 108 set pwd [pwd] 109 set psd [psd] 110 set pld [pld] 111 112 113 # modify cd to automatically set $pwd 114 115 if {[llength [info command ::tcl::cd]] == 0} { 116 rename cd ::tcl::cd 117 } 118 proc cd {{path "~"}} { 119 global pwd 120 ::tcl::cd $path 121 set pwd [pwd] 122 } 100 123 101 124 … … 187 210 global ::orxonox::errormessage_unknown ::orxonox::errormessage_unknown_length 188 211 189 tcl::puts "unknown: $args" 190 set errorcode [catch { ::tcl::unknown $args} result options]212 set cmd [concat ::tcl::unknown $args] 213 set errorcode [catch {eval $cmd} result options] 191 214 set resultlist [split $result] 192 215 set success 1 193 tcl::puts "errorcode: $errorcode resultlist: $resultlist" 216 194 217 if {$errorcode && [llength $resultlist] >= $::orxonox::errormessage_unknown_length} { 195 218 for {set i 0} {$i < $::orxonox::errormessage_unknown_length} {incr i} { … … 199 222 } 200 223 } 224 } else { 225 set success 0 201 226 } 202 tcl::puts "success: $success" 227 203 228 if {!$success} { 204 229 return -code $errorcode -options $options $result
Note: See TracChangeset
for help on using the changeset viewer.