Ignore:
Timestamp:
Feb 2, 2011, 4:51:29 PM (14 years ago)
Author:
mmc
Message:

Part 1 of a major reorganization of content. Moving "instant" to "builder"
and setting up "builder" more like the "gui" part as a package. Moving the
Rappture::object stuff from the builder into the main installation, so it
can be shared by the tester as well. Moving "driver" into gui/scripts
where it belongs. Creating a new "launcher.tcl" script that decides
which of the three parts to launch based on command line options. Still
need to sort out the Makefiles to get this all right...

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/lang/tcl/scripts/objects.tcl

    r2076 r2080  
    1717# ======================================================================
    1818#  AUTHOR:  Michael McLennan, Purdue University
    19 #  Copyright (c) 2004-2010  Purdue Research Foundation
     19#  Copyright (c) 2004-2011  Purdue Research Foundation
    2020#
    2121#  See the file "license.terms" for information on usage and
     
    2626namespace eval Rappture { # forward declaration }
    2727namespace eval Rappture::objects {
     28    # location of system object info
     29    variable installdir [file dirname [file normalize [info script]]]
     30
    2831    #
    2932    # Set up a safe interpreter for loading object defn files...
     
    6164    # this variable will hold the name of the object file being parsed
    6265    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# ----------------------------------------------------------------------
     76proc 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    }
    6396}
    6497
Note: See TracChangeset for help on using the changeset viewer.