;ς = ΔDc@scdkZdkiZdkTdkiZdkiZdki Z de i fd„ƒYZ e Z dS(N(s*sGameknotcBstZeZdgZddgZeidƒZeidƒZ eidƒZ eidƒZ eidƒZ d „Z d „Zeed gƒZeid ƒZeid ƒZeidƒZeidƒZeidƒZd„ZeeƒZd„ZeeƒZRS(NsWebsgameknotSnarfersgameknotStatsSnarfers"(\d+)s$s:(\d+)s7"#FFFF00">(\d+)[^"]+"#FFFF00">(\d+)[^"]+"#FFFF00">(\d+)s!Team:(<.*?>)+(?P.*?)s*(seen on GK:\s+([^[]+ago)|.*?is hiding.*?)c CsCd|}y—tii|ƒ}|ii|ƒi dƒ}|i i|ƒi dƒ} |i i|ƒiƒ\}} } yjt|ƒ}t| ƒ} t| ƒ} d||| | }d| || | }d| || | }Wn=ttfj o+|}d}| } d}| } d}nX|iitii|ƒƒ}|tjo d}nqd|i dƒjotd|ƒ}nH|i d ƒid ƒotd |ƒ}ntd ||i d ƒƒ}td t| ƒddfƒ} d|jop|ii|ƒi dƒ}tii|ƒ}td|||| |df| df| df||||ƒ } n=td||| |df| df| df||||ƒ } | SWn›t!j o]td|i"ƒƒ|jot#i$td|ƒ‚q?t#i$tdt%i&i'i(ƒƒ‚n4tii$j o!} t#i$tii*| ƒ‚nXdS(Ns#http://www.gameknot.com/stats.pl?%sif100.0f0.0ss is hidingis#%s is hiding his/her online status.is0s%s is on gameknot right now.s %s was last seen on Gameknot %s.s%nsactivesgamesTeam:snamesy%s (team: %s) is rated %i and has %s and a record of %n, %n, and %n (win/loss/draw percentage: %.2f%%/%.2f%%/%.2f%%). %sswinslosssdrawsn%s is rated %i and has %s and a record of %n, %n, and %n (win/loss/draw percentage: %.2f%%/%.2f%%/%.2f%%). %ssUser %s not found!sNo user %s exists.s#The format of the page was odd. %s(+snames gkprofilesutilsswebsgetUrlsprofilesselfs _gkratingssearchsgroupsratings_gkgamessgamess _gkrecordsgroupsswslsdsintswpslpsdps ValueErrorsZeroDivisionErrors_gkseens htmlToTextsseensNonesformats startswiths_gkteamsteamsssAttributeErrorslowers callbackssErrorsconfssupybotsrepliess possibleBugsesstrError(sselfsnamesratingsseens gkprofileslpsprofileswpsdpsdseslsssgamesswsteam((s./Gameknot/plugin.pysgetStats2sb !          cCs|i|i|ƒƒdS(sν Returns the stats Gameknot keeps on . Gameknot is an online website for playing chess (rather similar to correspondence chess, just somewhat faster) against players from all over the world. N(sircsreplysselfsgetStatssname(sselfsircsmsgsargssname((s./Gameknot/plugin.pysgkstatspsstexts#popd\('(Rating[^']+)'\).*?>([^<]+)(\d+)[^,]+, (\d+)[^,]+, (\d+)s]+>

(.*?)\s*
s >(\S+)\s+wonswon\s+\(\S+\s+(\S+)\)cCsb|id|idƒ odSn|idƒ}ytii |ƒ}Wn>tii j o,}|i idtii|ƒƒdSnXypd|jo!d}|i|dtƒdSn|ii|ƒ}|tjo|i id|ƒdSn|iƒ}ti|ƒ}|ii|ƒ} | o|i id |ƒdSn| \\}}\} }ti|ƒ}ti|ƒ}d |jo)d |jo|d }qO|d }n |i#i|ƒ}|o€|id ƒ}|i%i|ƒ}|o|id ƒ}nd}|djot'd|||ƒ}qOt'd|||ƒ}nd}|i(i|ƒiƒ\}}} }|i(i| ƒiƒ\} } } }t'd||| |ƒ}t'd| | | |ƒ}t'd||||||ƒ}|i|dt1ƒWnbt2j o)t'd|ƒ}|i id|ƒn/t3j o"}|i i4ti5|ƒƒnXdS(s0http://(?:www\.)?gameknot\.com/chess\.pl\?bd=\d+s gameSnarferiNs Unable to snarf Gameknot URL: %ssno longer availables!That game is no longer available.s prefixNicks_gkGameTitle didn't match %u.s_gkPlayer didn't match %u.s to move...s white to moves to move.islostswhites%s won, %s %s.sThe game was a draw.s%i; W-%i, L-%i, D-%is%s: %s (%s) vs. %s (%s); %ss/%u doesn't appear to be a proper Gameknot game.sUnable to snarf. %s(6sselfs registryValuesmsgsargssmatchsgroupsurlsutilsswebsgetUrlsssErrorseslogsdebugsstrErrorsircsreplysTrues _gkGameTitlessearchsmsNonesgroupss gameTitlesircutilssbolds _gkPlayersfindallsLswRatingswNamesbRatingsbNamestoMoves_gkWonswinners _gkReasonsreasonsformats _gkRatingswWinsswLossesswDrawssbWinssbLossessbDrawsswStatssbStatssFalses ValueErrors Exceptionswarnings exnToString(sselfsircsmsgsmatchsbStatsswWinssbNameswStatsswinnersbLossessbWinsswLossessbRatingsLstoMovesreasonsbDrawsseswRatingsurlsmsss gameTitleswDrawsswName((s./Gameknot/plugin.pysgameknotSnarfersr        $$cCsX|id|idƒ odSn|idƒ}|i|ƒ}|i |dt ƒdS(s(http://gameknot\.com/stats\.pl\?([^& ]+)s statSnarferiNis prefixNick( sselfs registryValuesmsgsargssmatchsgroupsnamesgetStatssssircsreplysFalse(sselfsircsmsgsmatchsnamess((s./Gameknot/plugin.pysgameknotStatsSnarferΓs (s__name__s __module__sTruesthreadeds callBeforesregexpssrescompiles _gkratings_gkgamess _gkrecords_gkteams_gkseensgetStatssgkstatsswraps _gkPlayers _gkRatings _gkGameTitles_gkWons _gkReasonsgameknotSnarfers urlSnarfersgameknotStatsSnarfer(((s./Gameknot/plugin.pysGameknot's(   >  B  ( sres supybot.utilssutilsssupybot.commandsssupybot.pluginsspluginsssupybot.ircutilssircutilsssupybot.callbackss callbackss PluginRegexpsGameknotsClass(s callbackssutilssGameknotsrespluginssClasssircutils((s./Gameknot/plugin.pys?s     ¦