Ignore:
Timestamp:
Mar 30, 2011 12:34:02 PM (13 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/blt4/lang/tcl/scripts/library.tcl

    r2150 r2170  
    1717    variable stdlib ""
    1818}
     19
     20# load the object system along with the XML library code
     21Rappture::objects::init
    1922
    2023# ----------------------------------------------------------------------
     
    133136
    134137        foreach cpath [$xmlobj children -as path $path] {
    135             switch -- [$xmlobj element -as type $cpath] {
     138            set type [$xmlobj element -as type $cpath]
     139            switch -- $type {
    136140                group - phase {
    137141                    lappend queue $cpath
     
    167171                }
    168172                default {
    169                     # add this to the return list with the right flavor
    170                     if {$params(-as) == "component"} {
    171                         lappend rlist $cpath
    172                     } else {
    173                         lappend rlist [$xmlobj element -as $params(-as) $cpath]
     173                    if {[catch {Rappture::objects::get $type}] == 0} {
     174                        # add this to the return list with the right flavor
     175                        if {$params(-as) == "component"} {
     176                            lappend rlist $cpath
     177                        } else {
     178                            lappend rlist [$xmlobj element -as $params(-as) $cpath]
     179                        }
    174180                    }
    175181
     
    200206    public method copy {path from args}
    201207    public method remove {{path ""}}
    202     public method xml {}
     208    public method xml {{path ""}}
    203209
    204210    public method diff {libobj}
     
    651657
    652658# ----------------------------------------------------------------------
    653 # USAGE: xml
     659# USAGE: xml ?<path>?
    654660#
    655661# Returns a string representing the XML information for the information
    656662# in this library.
    657663# ----------------------------------------------------------------------
    658 itcl::body Rappture::LibraryObj::xml {} {
    659     return [$_node asXML]
     664itcl::body Rappture::LibraryObj::xml {{path ""}} {
     665    if {"" != $path} {
     666        set n [find $path]
     667    } else {
     668        set n $_node
     669    }
     670    return [$n asXML]
    660671}
    661672
Note: See TracChangeset for help on using the changeset viewer.