Changeset 5f12935 in tol for tolbase/lib/toltk
- Timestamp:
- Feb 2, 2012, 8:39:53 PM (15 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- b83a49e
- Parents:
- fa8b47d
- Location:
- tolbase/lib/toltk
- Files:
-
- 2 edited
-
init_toltk.tcl (modified) (7 diffs)
-
project.tcl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tolbase/lib/toltk/init_toltk.tcl
rfa8b47d r5f12935 77 77 load $::env(USE_TOLTCL) 78 78 } else { 79 package require Toltcl 2.0.279 package require Toltcl 3.1 80 80 } 81 81 package require rmtps_client … … 134 134 135 135 #///////////////////////////////////////////////////////////////////////////// 136 proc loadInfoProjects { dir} {136 proc loadInfoProjects { prjini } { 137 137 # 138 138 # PURPOSE: Loads in a list the name and paths of each project to load … … 145 145 global toltk_script_path 146 146 147 set values {} 147 148 # File exists ? 148 149 set ok 0 149 set dirPrjIni "[file normalize $dir]/../../../" 150 set fileProject [file join $dirPrjIni "project.ini"] 151 if {[file exists $fileProject]} { 152 set ok [ file writable $fileProject ] 150 if { [ file isfile $prjini ] } { 151 if { [ file readable $prjini ] } { 152 set ok 1 153 set fileProject [ file normalize $prjini ] 154 # se intentara leer el iniproject.tol desde este sitio 155 lappend values Project,path,root [ file dir $fileProject ] 156 } else { 157 tk_messageBox -default ok -icon error \ 158 -message [ mc "The project does not exist, file not found or not readable: %s" $prj ] \ 159 -parent . -title "Error" -type ok 160 return "" 161 } 153 162 } else { 154 set fileProject [file join $dir "project.ini"] 163 # comportamiento anterior, pudiera limpiarse 164 lappend values Project,path,root "" 165 set pathInitTol "" 166 set dir $prjini 167 set dirPrjIni "[file normalize $dir]/../../../" 168 set fileProject [file join $dirPrjIni "project.ini"] 155 169 if {[file exists $fileProject]} { 156 set ok [ file writable $fileProject ] 170 set ok [ file writable $fileProject ] 171 } else { 172 set fileProject [file join $dir "project.ini"] 173 if {[file exists $fileProject]} { 174 set ok [ file writable $fileProject ] 175 } 157 176 } 158 177 } … … 161 180 set id [iniparse:openfile $fileProject] 162 181 catch { ::iniFile::Create $fileProject } 163 set values {}164 182 foreach prj $iniparse($id,sections) { 165 183 if { $prj eq "Project" } { … … 211 229 } 212 230 iniparse:closefile $id 213 return $values 214 } 215 return "" 231 } 232 return $values 216 233 } 217 234 … … 280 297 } 281 298 299 # Load project 300 namespace import project::* 301 set project::data(iniproject) 1 302 set state "" 303 set project::data(-project) $toltk_script_path 304 foreach option $argv { 305 if { $state eq "" } { 306 switch -- $option { 307 -b { 308 set project::data(oculto) 1 309 } 310 -np { 311 set project::data(iniproject) 0 312 } 313 -project { 314 set state "project" 315 } 316 default { 317 puts "unknown option $option" 318 } 319 } 320 } else { 321 switch $state { 322 project { 323 set project::data(-project) [ file normalize $option ] 324 } 325 default { 326 puts "unknown state $state" 327 } 328 } 329 set state "" 330 } 331 } 332 282 333 # Get info about project 283 set infoProjects [loadInfoProjects $toltk_script_path] 334 set infoProjects [ loadInfoProjects $project::data(-project) ] 335 project::project $infoProjects 284 336 285 337 # load iniFile … … 295 347 296 348 Tolcon_Trace "toltk_script_path=$toltk_script_path" 297 # Load project298 namespace import project::*299 set project::data(iniproject) 1300 foreach option $argv {301 if { [string equal $option "-b"] } {302 set project::data(oculto) 1303 } elseif { $option eq "-np" } {304 set project::data(iniproject) 0305 }306 }307 project::project $infoProjects308 309 349 310 350 Tolcon_Trace "begin" -
tolbase/lib/toltk/project.tcl
rfa8b47d r5f12935 165 165 } 166 166 # update 167 tol::initlibrary $data(iniproject) 167 if { $projects(Project,path,root) ne "" } { 168 set initol 0 169 set iniproject [ file join $projects(Project,path,root) "_iniproject.tol" ] 170 } else { 171 set initol $data(iniproject) 172 set iniproject "" 173 } 174 tol::initlibrary $initol 175 if { $iniproject ne "" } { 176 # incluyo _iniproject.tol relativo a -project 177 tol::include $iniproject 178 } 168 179 foreach prj $projects(Project,names) { 169 180 set prjname $projects(${prj},name)
Note: See TracChangeset
for help on using the changeset viewer.
