Changeset 1125


Ignore:
Timestamp:
12/15/11 12:18:26 (5 months ago)
Author:
james
Message:

Resurrect typofix stuff

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/output.tcl

    r1112 r1125  
    304304                        break 
    305305                } 
    306                 #set typosDone [bMotion_plugins_settings_get "output:typos" "typosDone" "" ""] 
    307                 #bMotion_putloglev 2 * "bMotion: typosDone is !$typosDone!" 
    308                 ## TODO: fix this 
    309                 #if {$typosDone != ""} { 
    310                 #       bMotion_plugins_settings_set "output:typos" "typosDone" "" "" "" 
    311                 #       if [rand 2] { 
    312                 #               bMotionDoAction $channel "" "%VAR{typoFix}" "" 1 
    313                 #       } 
    314                 #       bMotion_plugins_settings_set "output:typos" "typos" "" "" "" 
    315                 #} 
     306                global bMotion_typo_mutex bMotion_typos 
     307 
     308                if {$bMotion_typo_mutex == ""} { 
     309                        set bMotion_typo_mutex "locked" 
     310                        if [llength $bMotion_typos] { 
     311                                set output [join $bMotion_typos] 
     312                                bMotionDoAction $channel $output "%VAR{typoFix}" "" 1 
     313                                set bMotion_typos [list] 
     314                        } 
     315                        set bMotion_typo_mutex "" 
     316                } 
    316317        } 
    317318        return 0 
    318319} 
    319320 
     321 
     322proc bMotion_add_typofix { fix } { 
     323        global bMotion_typos bMotion_typo_mutex 
     324 
     325        if {$bMotion_typo_mutex != ""} { 
     326                return 
     327        } 
     328 
     329        lappend bMotion_typos $fix 
     330} 
    320331 
    321332#  
  • trunk/modules/variables.tcl

    r1109 r1125  
    6363set bMotionCache(randomUser) "" 
    6464 
     65set bMotion_typos [list] 
     66set bMotion_typo_mutex "" 
     67 
    6568bMotion_plugins_settings_set "system" "lastPlugin" "" "" "" 
    6669bMotion_plugins_settings_set "system" "last_simple" "" "" "" 
  • trunk/plugins/en/output_typos.tcl

    r1082 r1125  
    139139        if {[rand 100] > $typochance} { 
    140140                #don't typo at all 
     141                bMotion_putloglev 2 * "Not doing typos for $line" 
    141142                return $line 
    142143        } 
     
    183184 
    184185proc bMotion_plugin_output_typos_adderror { channel err } { 
    185   set currentErr [bMotion_plugins_settings_get "output:typos" "typos" "" ""] 
    186   if {$currentErr == ""} { 
    187     set currentErr $err 
    188   } else { 
    189     append currentErr " $err" 
    190   } 
    191   bMotion_plugins_settings_set "output:typos" "typos" "" "" $currentErr 
     186        bMotion_add_typofix $err 
    192187} 
    193188 
Note: See TracChangeset for help on using the changeset viewer.