Changeset 2170 for branches/blt4/lang/tcl/scripts/library.tcl
- Timestamp:
- Mar 30, 2011 12:34:02 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/lang/tcl/scripts/library.tcl
r2150 r2170 17 17 variable stdlib "" 18 18 } 19 20 # load the object system along with the XML library code 21 Rappture::objects::init 19 22 20 23 # ---------------------------------------------------------------------- … … 133 136 134 137 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 { 136 140 group - phase { 137 141 lappend queue $cpath … … 167 171 } 168 172 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 } 174 180 } 175 181 … … 200 206 public method copy {path from args} 201 207 public method remove {{path ""}} 202 public method xml { }208 public method xml {{path ""}} 203 209 204 210 public method diff {libobj} … … 651 657 652 658 # ---------------------------------------------------------------------- 653 # USAGE: xml 659 # USAGE: xml ?<path>? 654 660 # 655 661 # Returns a string representing the XML information for the information 656 662 # in this library. 657 663 # ---------------------------------------------------------------------- 658 itcl::body Rappture::LibraryObj::xml {} { 659 return [$_node asXML] 664 itcl::body Rappture::LibraryObj::xml {{path ""}} { 665 if {"" != $path} { 666 set n [find $path] 667 } else { 668 set n $_node 669 } 670 return [$n asXML] 660 671 } 661 672
Note: See TracChangeset
for help on using the changeset viewer.