;ò > ÄDc@s¾dkiZdkiZdkiZdkTdkiZdk i Z dk i Z dk iZdkiiZdkiiZdkZdeifd„ƒYZdeifd„ƒYZeZdS(N(s*sExternalNoticecBs)tZdZd„Zd„Zd„ZRS(s5Allow the supybot user to send a notice to a channel.cCsštii||ƒt|ƒ|_tii d|i ƒ|_tii |iƒoti |iƒnt i|i|iƒ|_ti|idƒdS(Ns~/.supybot-external-notice.%siÈ(s callbackssPlugins__init__sselfsircsSupyUDPsserversosspaths expandusersnicksexistssremovesreactorslistenUNIXDatagramslistenerschmod(sselfsirc((s./ExternalNotice/plugin.pys__init__/sc Cs?t}|iƒ} t| ƒdjoè| idƒ}| idƒ} di | ƒ}t }x˜t iD]} | i|jowt}t }xN| iiD]@}| |djo)t}ti||ƒ}| i|ƒq‘q‘W| od| }qïqbqbW| od|}q n|o|iid|ƒn|iidƒd S( s%Received a command over the UDP wire.iis isBad Channel "%s"sBad Network "%s"sAttempted external notice: %ssSuccessful external noticeN(sNoneserrorsdatassplits commanditemsslenspopsnetworkschannelsjoinstextsFalsesnetfoundsworldsircssircsTrues chanfoundsstateschannelss onchannelsircmsgssnoticesmssendMsgsselfslogsinfo( sselfsdatas onchannelsnetworkstextsnetfoundsms chanfoundserrorsircs commanditemsschannel((s./ExternalNotice/plugin.pysreceivedCommand9s4   cCs!|iiƒti|iƒdS(s9 Called on unload. Stop listening and remove the socket. N(sselfslisteners stopListeningsossremovespath(sself((s./ExternalNotice/plugin.pysdieTs (s__name__s __module__s__doc__s__init__sreceivedCommandsdie(((s./ExternalNotice/plugin.pysExternalNotice,s  sSupyUDPcBs tZdZd„Zd„ZRS(s! A very simple datagram protocol cCs ||_dS(N(scbsself(sselfscb((s./ExternalNotice/plugin.pys__init__\scCs|ii|ƒdS(s& Just pass the data on to the plugin. N(sselfscbsreceivedCommandsdata(sselfsdatasaddress((s./ExternalNotice/plugin.pysdatagramReceived_s(s__name__s __module__s__doc__s__init__sdatagramReceived(((s./ExternalNotice/plugin.pysSupyUDPYs  (s supybot.confsconfs supybot.utilssutilss supybot.worldsworldssupybot.commandsssupybot.ircmsgssircmsgsssupybot.pluginsspluginsssupybot.ircutilssircutilsssupybot.callbackss callbacksstwisted.internet.reactorsinternetsreactorstwisted.internet.protocolsprotocolsossPluginsExternalNoticesDatagramProtocolsSupyUDPsClass( sprotocolsreactorsSupyUDPsutilssExternalNoticesircmsgss callbackssconfspluginssworldsossClasssircutils((s./ExternalNotice/plugin.pys?s        -