;ò = ÄDc@spdkZdklZdkiZdkTdkiZdki Z dk i Z de i fd„ƒYZ e ZdS(N(sifilter(s*s GrasshoppazcBs_tZdZd„Zd„Zd„ZeedddgƒZd„ZeeddgƒZRS(s*Add the help for "@help Grasshoppaz" here.cCsL|io>|idjo.|i|idƒoti||idƒSdS(NsPRIVMSGi( smsgsprefixscommandsircs isChannelsargssircutilssstrEqualschan(sselfsircsmsgschan((s./Grasshoppaz/plugin.pys _validLastMsg+scCsÂti|ƒokti|ƒitdƒ}ydi|d ƒ|dgSWq¾tj odi|d ƒdgSq¾XnDti|ƒitdƒ}t |ƒdjo|i dƒn|SdS(Nis si( sircmsgssisActionsms prettyPrintssplitsNonesnsjoins IndexErrorsprettyslensappend(sselfsmsnspretty((s./Grasshoppaz/plugin.pys _normalize1s c soy?ˆid|ƒoti|tiƒ}nti|ƒ}Wn7tti fj o"}ˆi t |ƒdt ƒnXt|‡‡d†tˆiiƒƒ} | iƒx±| D]©}ˆi|ƒ\} } |i| ƒo~ˆid|ƒo2ˆidi| |i|| ƒgƒdtƒn2ˆidi| |i|| dƒgƒdtƒdSq±q±Wˆi d ƒdS( s Searches for the last message with and replaces all instances of with . scaseInsensitiveSearchsRaisecsˆiˆ||ƒS(N(sselfs _validLastMsgsircsmsc(smsc(sircsself(s./Grasshoppaz/plugin.pysKss globalReplaces s prefixNickiNs+I couldn't find a message with that phrase.(sselfs registryValueschannelsrescompilesssIssearchs ValueErrorserrorsesircsstrsTruesifiltersreversedsstateshistorysiterablesnextsmsgs _normalizespsmsreplysjoinssubsrsFalse( sselfsircsmsgsargsschannelsssrssearchsespsmsiterable((sselfsircs./Grasshoppaz/plugin.pyss>s( 2'  s onlyInChannels somethingstextc s}y?ˆid|ƒoti|tiƒ} nti|ƒ} Wn7tti fj o"}ˆi t |ƒdt ƒnXt|‡‡d†tˆiiƒƒ} | iƒt}x¢| D]š}ˆi|ƒ\}} | i| ƒoo|o^d|jo)ˆid|iƒddtƒdSqMˆid|id ƒdtƒdSqQt }q·q·W|o d } nd } ˆi | ƒdS( s” Determines who was the first person to say . Useful when two people say similar things at the same time. scaseInsensitiveSearchsRaisecsˆiˆ||ƒS(N(sselfs _validLastMsgsircsmsc(smsc(sircsself(s./Grasshoppaz/plugin.pysgss s%s wins!is prefixNickNs<>s*I only found one message with that phrase.s+I couldn't find a message with that phrase.(sselfs registryValueschannelsrescompilestextsIsss ValueErrorserrorsesircsstrsTruesifiltersreversedsstateshistorysiterablesnextsFalses foundLastsmsgs _normalizespsmssearchsreplyssplitsstrip( sselfsircsmsgsargsschannelstextses foundLastspsmsssiterable((sselfsircs./Grasshoppaz/plugin.pyswinZs4  !  (s__name__s __module__s__doc__s _validLastMsgs _normalizessswrapswin(((s./Grasshoppaz/plugin.pys Grasshoppaz)s    "(sres itertoolssifilters supybot.utilssutilsssupybot.commandsssupybot.ircmsgssircmsgsssupybot.ircutilssircutilsssupybot.callbackss callbackssPrivmsgs GrasshoppazsClass(sifilters callbackssutilssircmsgssres GrasshoppazsClasssircutils((s./Grasshoppaz/plugin.pys?s      V