Changeset 2080 for trunk/lang/tcl/scripts/objects.tcl
- Timestamp:
- Feb 2, 2011, 4:51:29 PM (14 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/lang/tcl/scripts/objects.tcl
r2076 r2080 17 17 # ====================================================================== 18 18 # AUTHOR: Michael McLennan, Purdue University 19 # Copyright (c) 2004-201 0Purdue Research Foundation19 # Copyright (c) 2004-2011 Purdue Research Foundation 20 20 # 21 21 # See the file "license.terms" for information on usage and … … 26 26 namespace eval Rappture { # forward declaration } 27 27 namespace eval Rappture::objects { 28 # location of system object info 29 variable installdir [file dirname [file normalize [info script]]] 30 28 31 # 29 32 # Set up a safe interpreter for loading object defn files... … … 61 64 # this variable will hold the name of the object file being parsed 62 65 variable currFile "" 66 } 67 68 # ---------------------------------------------------------------------- 69 # USAGE: Rappture::objects::init 70 # 71 # Called at the beginning of a Rappture program to initialize the 72 # object system. Loads all object definitions in the "objects" 73 # directory found at the system location. Object types can be 74 # queried by calling Rappture::objects::get. 75 # ---------------------------------------------------------------------- 76 proc Rappture::objects::init {} { 77 variable installdir 78 79 # load supporting type definitions 80 foreach fname [glob [file join $installdir types *.tcl]] { 81 source $fname 82 } 83 84 # load supporting validation procs 85 foreach fname [glob [file join $installdir validations *.tcl]] { 86 source $fname 87 } 88 89 # load the base class 90 Rappture::objects::load [file join $installdir objects base.rp] 91 92 # load any other classes found 93 foreach dir [glob -nocomplain -types d [file join $installdir objects *]] { 94 Rappture::objects::load [file join $dir *.rp] 95 } 63 96 } 64 97
Note: See TracChangeset
for help on using the changeset viewer.