Changeset 1342 for trunk/gui/scripts/resources.tcl
- Timestamp:
- Mar 18, 2009, 2:59:21 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/resources.tcl
r924 r1342 28 28 variable optionParser [interp create -safe] 29 29 foreach cmd [$optionParser eval {info commands}] { 30 30 $optionParser hide $cmd 31 31 } 32 32 # this lets us ignore unrecognized commands in the file: … … 45 45 variable optionParser 46 46 foreach {name proc} $args { 47 47 $optionParser alias $name $proc 48 48 } 49 49 } … … 71 71 global auto_index 72 72 foreach name [array names auto_index *_init_resources] { 73 73 eval $name 74 74 } 75 75 … … 80 80 # 81 81 if {[info exists env(SESSIONDIR)]} { 82 83 84 85 82 set file $env(SESSIONDIR)/resources 83 if {![file exists $file]} { 84 return 0 85 } 86 86 87 88 89 90 91 92 93 94 95 96 97 87 if {[catch { 88 set fid [open $file r] 89 set info [read $fid] 90 close $fid 91 $optionParser eval $info 92 } result]} { 93 if {"" != $callback} { 94 after 1 [list $callback -title Error -icon error -message "Error in resources file:\n$result"] 95 } 96 return 0 97 } 98 98 } 99 99 return 1
Note: See TracChangeset
for help on using the changeset viewer.