;ò > ÄDc@sdkZdkZdkZdkZdkiZdkiZdk i Z dk Tdk i Z dkiZdkiZdkiZdddgZddddd d d gZd d ddddgZdddddgZdZhde<de<de<de<de<de<de<deswhoswhatswhenswhereswhysitsthatsthisstheysthesesthosesrosessredsvioletssbluesPickleInfobotDBcBsËtZd„Zd„Zeed„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCs:||_tiƒ|_tiƒ|_tiƒ|_dS(N(sfilenamesselfsircutilssIrcDictsdbsschangess responses(sselfsfilename((s./Infobot/plugin.pys__init__Ys c Csti|i|ƒ}||ijonDtii|ƒo—t |ƒ}yFt i |ƒ\}}||f|i|is£CREATE TABLE isFacts ( key TEXT UNIQUE ON CONFLICT REPLACE, value TEXT );s¤CREATE TABLE areFacts ( key TEXT UNIQUE ON CONFLICT REPLACE, value TEXT );( ssqlites ImportErrors callbackssErrorspluginssmakeChannelFilenamesselfsfilenameschannelschangess responsessdbssosspathsexistssconnectsdbscursorsexecutescommits initialIss iteritemssksvssetIss initialAressetAres DatabaseErrorsesdbisInvalidDBErrorsstr( sselfschannelssqlitesesvsdbsfilenamescursorsk((s./Infobot/plugin.pys_getDbðs@          cCs5x!|iiƒD]}|iƒqW|iiƒdS(N(sselfsdbss itervaluessdbsclosesclear(sselfsdb((s./Infobot/plugin.pysclosescCs|iticd7isNot sending empty factoid.sisactions%s %s %s, $who($sircsNonesselfsmsgsisAreslowersdynamicschannelsdbshasIsskeysgetIssvalueshasAresgetAreslogsdebugsdbisInvalidDBErrorseserrors addressedsdunnosDunnosutilssiterschoicessplitslvalues startswithsstripsreplysTruesformatsssprepend( sselfskeysircsmsgsdunnosprependsisAreslvaluesesvaluessschannel((s./Infobot/plugin.pysfactoidés`                s^i am s%s is s^my s%s's s^your cCs ti|ƒ}|iƒ}tii|ƒ}|idi |id||ƒ}|i di |i d||ƒ}|i di |i d||ƒ}ddfddfddfd d fg}x<|D]4\}}|i|ƒo||t|ƒ}qÊqÊW|SdS( Niiswhat'sswhat isswhere'sswhere isswho'sswho isswtf'sswtf is(sircutilssstripFormattingsssstripsutilssstrsnormalizeWhitespacesselfs_iAmssubsnicks_mys_yoursbots contractionss contractions replacements startswithslen(sselfsssbotsnicks contractionss replacements contraction((s./Infobot/plugin.pys normalize&s $$$* s ^no[,: -]+cCs×z½ti|ƒo|iidƒdSnti|i |ƒ}|i |p |i d|i |i ƒ}|o|id|ƒntid|i d|fd|ƒ}|ii||ƒWdt|_t|_XdS(Ns,Returning early from doPrivmsg: isCtcp(msg).is addressedsargsismsg(sircmsgssisCtcpsmsgsselfslogsdebugs callbackss addressedsircsnicksss normalizesargsspayloadstagsIrcMsgs_Infobot__parents doPrivmsgsFalseschangedsadded(sselfsircsmsgssspayload((s./Infobot/plugin.pys doPrivmsg5s)% cOsbzH||_||_ti|idƒ}|ii|||||ŽWdt |_t |_XdS(Ni( sircsselfsmsgspluginss getChannelsargsschannels_Infobot__parents callCommandsnamesLskwargssNone(sselfsnamesircsmsgsLskwargsschannel((s./Infobot/plugin.pys callCommandDs    cOsbzH||_||_ti|idƒ}|ii|||||ŽWdt |_t |_XdS(Ni( sircsselfsmsgspluginss getChannelsargsschannels_Infobot__parents _callRegexpsnamesLskwargssNone(sselfsnamesircsmsgsLskwargsschannel((s./Infobot/plugin.pys _callRegexpOs    cCs«|idƒ}t}xS|ii|iigD]9}y|t i |ƒt }Wq.t ij oq.Xq.W|o|iƒn(|io|i|d|d|ƒndS(s^forget\s+(.+?)[?!. ]*$isircsmsgN(smatchsgroupsfactsFalsesdeletedsselfsdbsdelIssdelAresmethodsdynamicschannelsTruesdbis NoRecordErrorsconfirmsmsgs addressedsmissingsirc(sselfsircsmsgsmatchsdeletedsmethodsfact((s./Infobot/plugin.pysdoForgetZs   c CsZ|iƒ\}} }}|i og|tjo|i i dƒdSn|i dƒ}t i||iƒ o|i i dƒdSqÏnF|tj o8|i dƒ}t i||iƒ o|| } qÏn|iƒ}|iodSnti} |dddfjo¢|ii| | ƒoˆ|ii| | ƒ}|iƒ|iƒjo!|itd|iƒƒdSn|i i d | |ƒt|_|ii| | |ƒqLnŸ|ii| | ƒoˆ|ii| | ƒ}|iƒ|iƒjo!|itd|iƒƒdSn|i i d | |ƒt|_|ii| | |ƒn|i ƒdS( sD^no,\s+(\w+,\s+)?(.+?)\s+(?^(.+?)\s+(?] Returns the number of changes and requests made to the Infobot database since the plugin was loaded. is only necessary if the message isn't in the channel itself. soptionalsrequiresunaddressed.answerQuestionssSince %s, there %h been %n and %n. I have been awake for %s this session, and currently reference %n. Addressing is in %s mode.s modificationsquestionsfactoidN(sselfsdbsgetChangeCountschannelschangessgetResponseCounts responsesstimesnowsintsworlds startedAtsdiffsTruesFalsesmodes registryValuesanswersircsreplysformatsctimesutilss timeElapseds getNumFacts( sselfsircsmsgsargsschannelsnows responsessanswersmodesdiffschanges((s./Infobot/plugin.pysstatss  s channeldbc CsÃy|ii|ƒ} Wn/tj o#|itd|ƒdtƒnXt i |i|d| ƒ} y<td|iƒ}|i |d| d|ƒ|idƒWntj o|iƒnXdS( sª[] [about] Tells about . is only necessary if the message isn't sent in the channel itself. s/I haven't seen %s, I'll let you do the telling.sRaisesprefixs%s wants you to know that smsgsprepends repliedToN(sircsstatesnickToHostmasksnickshostmasksKeyErrorserrorsformatsTruesircmsgssprivmsgsfactoidsnewmsgsmsgsprependsselfstagsDunnosdunno( sselfsircsmsgsargsschannelsnicks_sfactoidsprependshostmasksnewmsg((s./Infobot/plugin.pystells s somethingsliteralsaboutstextc Cs‹|iƒ}|djo|ii} n|djo|ii} nd}yti i |ƒ} WnLti i j o:yt|ƒ} Wq±tj o|idƒq±XnXx­| D]¥} | idƒ} y| iddƒ\}} Wn)tj o|iid| ƒq¸q¸X|iƒ}| iƒ} |iid || ƒ| ||| ƒ|d7}q¸W| iƒ|itd |d fƒƒd S( s[] {is,are} Updates the Infobot database using the dumped database at remote or local . The first argument should be "is" or "are", and determines whether the is or are database is updated. sissareis url or files s => isInvalid line: %rs Adding factoid %r with value %r.s %n added.sfactoidN(sisAreslowersselfsdbssetIssaddssetArescountsutilsswebsgetUrlFdsurlsfdsErrorsfilesEnvironmentErrorsircs errorInvalidslinesrstripssplitskeysvalues ValueErrorslogsdebugslstripschannelscloses replySuccesssformat( sselfsircsmsgsargsschannelsisAresurlscountskeysvaluesaddsfdsline((s./Infobot/plugin.pysupdate/s:      sownersissaresurl('s__name__s __module__saddressedRegexpssunaddressedRegexpss__init__sdiesresetsNoneserrorsFalsesTruesreplysconfirmsmissingsdunnosfactoidsrescompilesIs_iAms_mys_yours normalizes_forceRes doPrivmsgs callCommands _callRegexpsdoForgetsdoForcesdoChanges doUnknowns doFactoidsstatsswrapsstatusstellsoptionalsupdatesfirst(((s./Infobot/plugin.pysInfobot¢s@  :    ,  F  ' #(%sossrestimescPicklespickles supybot.dbisdbis supybot.utilssutilss supybot.worldsworldssupybot.commandsssupybot.ircmsgssircmsgsssupybot.pluginsspluginsssupybot.ircutilssircutilsssupybot.callbackss callbackssendssdunnossstartssconfirmss NORESPONSEs initialIss initialAresobjectsPickleInfobotDBsSqliteInfobotDBsDBs InfobotDBs ExceptionsDunnos PluginRegexpsInfobotsClass(sdbisutilssircmsgssSqliteInfobotDBspluginsspicklesconfirmssresInfobotsPickleInfobotDBsdunnossClasssendssDunnos callbackss initialAresworlds initialIssstartss InfobotDBstimesoss NORESPONSEsircutils((s./Infobot/plugin.pys?s4           N i ‘² ÿµ