Changeset 1041 for trunk/modules/abstract.tcl
- Timestamp:
- 10/16/09 14:59:20 (3 years ago)
- File:
-
- 1 edited
-
trunk/modules/abstract.tcl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/abstract.tcl
r1032 r1041 136 136 global bMotionModules bMotion_testing bMotion_loading 137 137 global bMotionInfo bMotion_abstract_languages bMotion_abstract_dir 138 global bMotion_abstract_last_get 138 global bMotion_abstract_last_get bMotion_abstract_filters 139 139 140 140 #set timestamp to now … … 142 142 set lang $bMotionInfo(language) 143 143 set bMotion_abstract_last_get($abstract) "" 144 set bMotion_abstract_filters($abstract) "" 144 145 145 146 #load any existing abstracts … … 508 509 proc bMotion_abstract_revive_language { } { 509 510 global bMotionSettings bMotionInfo bMotionModules 510 global bMotion_abstract_contents bMotionLocal 511 512 set lang $bMotionInfo(language) 511 global bMotion_abstract_contents bMotionLocal bMotion_abstract_filters 512 513 set lang $bMotionInfo(language) 514 513 515 514 516 bMotion_putloglev 2 * "bMotion: reviving language ($lang) abstracts" … … 582 584 583 585 # filter out stuff from an abstract 584 proc bMotion_abstract_filter { abstract filter _text} {586 proc bMotion_abstract_filter { abstract filter } { 585 587 global bMotion_abstract_contents bMotion_abstract_ondisk 586 588 … … 596 598 597 599 if {[llength $contents] == 0} { 598 bMotion_putloglev d * "can't get contents for $abstract" 600 if {$abstract != "_all"} { 601 bMotion_putloglev d * "can't get contents for $abstract" 602 } 599 603 return 600 604 } … … 605 609 foreach element $contents { 606 610 bMotion_putloglev 2 * "considering $element for filtering" 607 if [regexp $filter_text $element] { 608 bMotion_putloglev 1 * "abstract $abstract element $element matches filter, dropping" 609 continue 610 } 611 lappend new_contents $element 611 set do_filter 0 612 foreach filter_text $filter { 613 if {(!$do_filter) && [regexp $filter_text $element]} { 614 bMotion_putloglev 1 * "abstract $abstract element $element matches filter $filter_text, dropping" 615 set do_filter 1 616 } 617 } 618 if {!$do_filter} { 619 lappend new_contents $element 620 } 612 621 } 613 622 614 623 set new_size [llength $new_contents] 615 624 set diff [expr $initial_size - $new_size] 616 bMotion_putloglev d * "abstract $abstract reduced by $diff items with filter $filter _text"625 bMotion_putloglev d * "abstract $abstract reduced by $diff items with filter $filter" 617 626 618 627 if {$diff > 0} { … … 635 644 636 645 bMotion_abstract_filter $abstract $filter 646 catch { 647 set filter $bMotion_abstract_filter(_all) 648 bMotion_abstract_filter $abstract $filter 649 } 637 650 } 638 651 … … 641 654 global bMotion_abstract_filters 642 655 643 set bMotion_abstract_filters($abstract) $filter_text 656 lappend bMotion_abstract_filters($abstract) $filter_text 657 644 658 bMotion_putloglev d * "registered filter /$filter_text/ for abstract $abstract" 645 659
Note: See TracChangeset
for help on using the changeset viewer.
