Ϫf^dZddlmZmZddlmZddlmZddlmZm Z m Z ddl m Z mZddlmZmZmZddlmZdd lmZdd lmZmZdd lmZeej8Gd d Zeej<GddZdZ eejBGddejDZ#GddejHZ%GddejLZ'eejBGddejPZ)ejTe'e)GddejLZ+eej8GddejPZ,ejTe+e,GddejLZ-eejBGdd ejLZ.ee.ej<ej^Gd!d"ejPZ0ejTe.e0ee jbejdGd#d$Z3Gd%d&e3Z4gd'Z5y())a A module that needs a better name. Implements new cred things for words. How does this thing work? - Network connection on some port expecting to speak some protocol - Protocol-specific authentication, resulting in some kind of credentials object - twisted.cred.portal login using those credentials for the interface IUser and with something implementing IChatClient as the mind - successful login results in an IUser avatar the protocol can call methods on, and state added to the realm such that the mind will have methods called on it as is necessary - protocol specific actions lead to calls onto the avatar; remote events lead to calls onto the mind - protocol specific hangup, realm is notified, user is removed from active play, the end. )ctimetime) implementer) copyright) credentialserrorportal)deferprotocol)failurelogreflect)registerAdapter)pb)ewordsiwords)irccDeZdZdZdZdZdZd dZdZdZ d Z d Z y) Groupc4||_i|_ddd|_y)N)topic topic_author)nameusersmetaselfrs 7/usr/lib/python3/dist-packages/twisted/words/service.py__init__zGroup.__init__.s    c@tjt||SN)r Failure Exception)rerrps r _ebUserCallzGroup._ebUserCall6syC011r!c||D]7\}}|r |j\}}|j||j9yr#)valueremovegetErrorMessage)rresultssuccessresultuserr&s r _cbUserCallzGroup._cbUserCall9s<& 9OGV"LL c D#"5"5"78 9r!c>tjj|sJdj||j|j vrg}||j |j<|j j D]V}||ustj|j||}|j|j||j|Xtj|j|jtj dS)Nz{!r} is not a chat clientr')r IChatClient providedByformatrrvaluesr maybeDeferred userJoined addErrbackr(append DeferredList addCallbackr1succeed)rr0 additionsr'ds raddz Group.add?s!!,,T2 4O4V4V 5  2 99DJJ &I$(DJJtyy !ZZ&&( (D=++ALL$EALL!1!1QL7$$Q'  (   y ) 5 5d6F6F G}}T""r!Nc |j|j=g}|jjD]W}||ustj|j |||}|j |j||j|Ytj|j|jtjdS#t$rY wxYwNr3)rrr7r r8userLeftr:r(r;r<r=r1KeyErrorr>)rr0reasonremovalsr'r@s rr+z Group.removeNs G 499%HZZ&&( 'D=++AJJdFKALL!1!1QL7OOA&  '   x ( 4 4T5E5E F}}T""   sC CCcRtjt|jSr#)r r>lenrrs rsizez Group.size]s}}S_--r!c||usJg}|jjD]W}||ustj|j|||}|j |j ||j|Ytj|j|jtjdSrC) rr7r r8receiver:r(r;r<r=r1r>)rsender recipientmessagereceivesr'r@s rrMz Group.receive`sD   ""$ #A'' 64I T-- 3"  # 8$001A1AB}}T""r!cv||_g}|jjD]Q}tj|j ||}|j |j||j|Stj|j|jtjdSrC) rrr7r r8groupMetaUpdater:r(r;r<r=r1r>)rrsetsr'r@s r setMetadatazGroup.setMetadataks ""$ A##A$5$5tTBA LL))QL / KKN  4 ,,T-=-=>}}T""r!cHt|jjSr#)iterrr7rJs r iteruserszGroup.iterusersusDJJ%%'((r!r#) __name__ __module__ __qualname__r r(r1rAr+rKrMrUrXr!rrr,s/ 29 # #. ##)r!rc@eZdZdZdZdZdZdZd dZdZ dZ dZ y) UserNc>||_g|_t|_yr#)rgroupsr lastMessagers rr z User.__init__s  6r!c>||_||_t|_yr#)realmmindrsignOn)rrcrds rloggedInz User.loggedIns  f r!cffd}jjj|S)Nc>jj|Sr#)r`r;r/grouprs rcbJoinzUser.join..cbJoin KK  u %Mr!)rArdr=)rrjrks`` rjoinz User.joins( yy#//77r!chfd}jj|j|S)Nc>jj|Sr#)r`r+ris rcbLeavezUser.leave..cbLeaverlr!)r+rdr=)rrjrFrps`` rleavez User.leaves* ||DIIv.::7CCr!cZt|_|j|j||Sr#)rrarMrd)rrOrPs rsendz User.sends%6  Iw??r!c,t|jSr#)rWr`rJs r itergroupszUser.itergroupssDKK  r!cN|jddD]}|j|yr#)r`rq)rgs rlogoutz User.logouts$Q A JJqM r!r#) rYrZr[rcrdr rfrmrqrsrurxr\r!rr^r^zs1 E D"  8D@!r!r^zNickServ!NickServ@servicesceZdZdZdZdZdZdZdZdZ dZ dZ dZ d-dZ d Zd ZdZdZd Zd Zd ZdZdZej0dfej2dfej4dfej6dfgZej:dfej<dfgZdZ dZ!dZ"dZ#d-dZ$d-dZ%dZ&dZ'dZ(dZ)d Z*d!Z+d"Z,d#Z-d$Z.d%Z/d&Z0d'Z1d(Z2d)Z3d*Z4d+Z5d,Z6y).IRCUserzM Protocol instance representing an IRC user connected to the server. Nutf-8c|j|_|jj|_|jj|_yr#)irc_NICKSERV_PRIVMSG irc_PRIVMSGfactoryrcrhostnamerJs rconnectionMadezIRCUser.connectionMades044\\''   r!cL|j|jd|_yyr#)rxavatarrrFs rconnectionLostzIRCUser.connectionLosts! ;; " KKMDK #r!c^d|vr|j|d<d|vr(|jj|j|d<|||dgt |z}g}|D]4}t |t r|jd}|j|6tjj|i|y)Nprefixtor{) rrencodeencodinglist isinstancebytesdecoder;rIRC sendMessage)rcommandparameter_listkwarglistarglistUnicodeargs rrzIRCUser.sendMessages 2 ==BxL r>yy'' 6BtH"T(+d>.BB 'C#u%jj)  ! !# & ' ^2r2r!c|j|jd|jd|jd|jzy)N!@#)rmrrrrjr0s rr9zIRCUser.userJoineds6 TYYKq 1T]]ONOr!c|j|jd|jd|jd|jz|xsdy)Nrrrleaving)partrrrrjr0rFs rrDzIRCUser.userLeftsB yyk499+Qt}}o 6 %**   y r!c:tjj|rd|jz}n |j}|j dd}|j D];}|j |jd|jd|j||=y)Nrtextzrr)rIGroupr5rget splitlinesprivmsgr)rrNrOrP recipientNamerLs rrMzIRCUser.receives == # #I .)..0M%NNM{{6#AB" A LL;;-q Qt}}o>  r!c d|vrU|d}|jdd}|j|jd|jz||d|d|jyy)Nrrrrrr)rrrr)rrjrrauthors rrSzIRCUser.groupMetaUpdatesa d?MEXXnb1F JJ ejj (!F81T]]O4   r!c|d|_y)z Password message -- Register a password. Parameters: [REQUIRED] Note that IRC requires the client send this *before* NICK and USER. N)passwordrrparamss rirc_PASSzIRCUser.irc_PASSsr  r!c |d} t|tr|j|j}||_ ||_ |jD].\}}|j|||jjz0|j |j t |dy|j }d|_|j#||y#t$r=|j t t|d|jjYywxYw)zh Nick message -- Set your nickname. Parameters: [REQUIRED] rz;Your nickname cannot be decoded. Please use ASCII or UTF-8.Nz Password?)rrrrUnicodeDecodeErrorrNICKSERVrepr transportloseConnectionnicknamer _motdMessagesrr _serverInforlogInAs)rrrrcoderrs rirc_NICKzIRCUser.irc_NICK s!9 (E*#??4==9!  ,, DJD$   T4$,,*B*B#B C D == LL8[ 9}}H DM LL8 ,)"  LLXM  NN ) ) +  s+CAD  D c|d|_y)zk User message -- Set your realname. Parameters: rN)realnamers rirc_USERzIRCUser.irc_USER/sr  r!c|d}|d}|j|jjy|jdk7r"|j t |jdy|j}d|_|j ||y)^ Send a (private) message. Parameters: rrNnickservz1Denied. Please send me (NickServ) your password.)rrrlowerrrr)rrrtargetrrs rr}zIRCUser.irc_NICKSERV_PRIVMSG:sw ": == NN ) ) + \\^z ) LL C  }}H DM LL8 ,r!c|jjjtj|||t j }|j|j|j|fy)N) errbackArgs) rr loginrUsernamePasswordrIUser addCallbacks_cbLogin_ebLogin)rrrr@s rrzIRCUser.logInAsQsR LL   % %  ( (8 [ ] NPONG)rcrrrs rirc_PINGzIRCUser.irc_PINGs' :: !   VT]] 3 "r!c8|jjy)z> Quit Parameters: [ ] N)rrrs rirc_QUITzIRCUser.irc_QUITs %%'r!c|r!|jtjdy|j|jd|jzdy)N:Unknown MODE flag.r+)rrERR_UNKNOWNMODE channelModer)rrjmodesargss r _channelModezIRCUser._channelModes;    S002G H   TYYejj(8# >r!c|r!|jtjdy||jur!|jtjdy|jtj dy)Nrrz(:You can't look at someone else's modes.)rrrr RPL_UMODEISERR_USERSDONTMATCH)rr0rs r _userModezIRCUser._userModesV    S002G H T[[   S__c 2   &&(R r!c $ d}t|tr|jj}|jdrOfd}jj|dd}|jj|tddyfd}jj|}|jj|tddy#t$r'j t jddYywxYw) z User mode message Parameters: *( ( "+" / "-" ) *( "i" / "w" / "o" / "O" / "r" ) ) rz2:No such nickname (could not decode your unicode!)Nrc|jtjjtj ddy)Nr:That channel doesn't exist.trapr NoSuchGrouprrERR_NOSUCHCHANNELr&rrs rebGroupz!IRCUser.irc_MODE..ebGroups5++,  ))6!96Tr!) callbackArgscFjtjdy)Nz:No such nickname.rrERR_NOSUCHNICK)r&rs rebUserz IRCUser.irc_MODE..ebUsers  !3!35IJr!)rrrrrrrr startswithrc lookupGrouprrtuple lookupUserr)rrr channelOrUserrr@rs` ` rirc_MODEzIRCUser.irc_MODEs "1IM-/ - 4 4T]] C   # #C (   &&}QR'89A NN4,,gE&QRQS*DUN V K %%m4A NN4>>6fQRj@QN R1"    ""q D    s0C-DDcy)zl Userhost message Parameters: *( SPACE ) [Optional] Nr\rs r irc_USERHOSTzIRCUser.irc_USERHOSTs r!c |dttrjj|djdrjjdd}n+jjjd}fd}fd }|j||y#t$r'j t j|ddYywxYw) rrz6:No such nick/channel (could not decode your unicode!)Nrrrc|jSr#)rd)r0s rz%IRCUser.irc_PRIVMSG..s TYYr!cF|jj|diSy)Nr)rrs)targ messageTextrs rcbTargetz%IRCUser.irc_PRIVMSG..cbTargets*{{''v{.CDD r!cHjtjdy)Nz:No such nick/channel.r)r&r targetNames rebTargetz%IRCUser.irc_PRIVMSG..ebTargets   S//=U Vr!)rrrrrrrrrrcrrr=r)rrrrrrrrs` @@rr~zIRCUser.irc_PRIVMSGs J*e,'..t}}= Rj   %ZZ++JqrN;FZZ**:6BB&F E W Hh//"    ""q H    s0B44-C$#C$ch |dttrjjjdrddfd}fd}jjj||y#t$r'j t j|ddYywxYw)zm Join message Parameters: ( *( "," ) [ *( "," ) ] ) r1:No such channel (could not decode your unicode!)Nrrcffd}jjj|S)NcjjjdjzjDcgc]}|jc}j ycc}wNr)r9namesrrX _sendTopic)ignr0rjrs rrkz1IRCUser.irc_JOIN..cbGroup..cbJoins\t, II%**$+0??+<=4TYY= &>s A6 rrmr=)rjrkrs` rcbGroupz!IRCUser.irc_JOIN..cbGroups* ';;##E*66v> >r!cNjtjdzdy)Nrz:No such channel.)rrrr& groupNamers rrz!IRCUser.irc_JOIN..ebGroups#   %%sY8K r!) rrrrrrrrrrcgetGroupr)rrrrrrs` @rirc_JOINzIRCUser.irc_JOINs q I)U+%,,T]];     $!!" I ?  I&33GWE9"    %%q C    0B-B10B1c |dt|dtr|djjjdrddt|dkDr'|dttrjdndfd}fd}jjj||y#t$r'j t j|ddYywxYw) zc Part message Parameters: *( "," ) [ ] rz:Could not decode your unicode!Nrrr{cjfd}jjj|S)Nc,jyr#)rD)r/rjrFrs rrpz2IRCUser.irc_PART..cbGroup..cbLeave@s eT62r!)rrqr=)rjrprFrs` rrz!IRCUser.irc_PART..cbGroup?s, 3;;$$UF3??H Hr!c|jtjjtj dzd|j zy)Nr:)rrrrrERR_NOTONCHANNELr,rs rrz!IRCUser.irc_PART..ebGroupEsB HHV'' (   $$cIosS=P=P=R7R r!) rrrrrrrrrrIrcrr)rrrrrrrFs` @@rirc_PARTzIRCUser.irc_PART%s  q I&)U+"1I,,T]];     $!!" I v;?AYF&%(w/F I   y)66wH9"    $$fQi1R    s6C-C0/C0ch |dttrjjjdrddfd}fd}jjj||y#t$r'j t j|ddYywxYw)zb Names message Parameters: [ *( "," ) [ ] ] rrNrrcjjd|jz|jDcgc]}|jc}ycc}wr )r rrX)rjr0rs rrz"IRCUser.irc_NAMES..cbGroupes< JJ 3+EOODU-VDdii-V -VsA c|jtjjjdzgyr )rrrr rr&channelrs rrz"IRCUser.irc_NAMES..ebGroupjs- HHV'' ( JJtyy#- 4r!) rrrrrrrrrrcrr)rrrrrr"s` @r irc_NAMESzIRCUser.irc_NAMESMs RjG'5)!..7   c "abkG   5 w'44WgF+"    %%r C    rc` |d}t|dtr|j|j}|jdr|dd}t|dkDr|j||dy|j|y#t$r#|j t jdYywxYw)zJ Topic message Parameters: [ ] rz<:That channel doesn't exist (could not decode your unicode!)Nrr) rrrrrrrrrrI _setTopic _getTopic)rrrr"s r irc_TOPICzIRCUser.irc_TOPICqs QiG&)U+!..7   c "abkG v;? NN7F1I . NN7 #"    %%N    s3B)B-,B-c`|jjd}|r|jjdxsd}|jjdd}|j|jd|jz||j |jd|jz||yy)zP Send the topic of the given group to this user, if it has one. rrz topic_daterrN)rrrr topicAuthor)rrjrrdates rr zIRCUser._sendTopics w' ZZ^^N3@yF::>>,2D JJtyy# "2E :   TYYejj(8&$ G r!c~fd}jjjj|y)Nc|jtjjtj ddyN=rrr!s rrz"IRCUser._getTopic..ebGroup3 HHV'' (   %%sG5S r!)rcrrr )rr"rs`` rr&zIRCUser._getTopics-  w'44T__gNr!cxfd}fd}jjj||y)Ncjj}|d<j|d<tt |d<fd}j |j |S)Nrrr)cbjtjdjzdy)Nrz.:You need to be a channel operator to do that.)rrERR_CHANOPRIVSNEEDEDr)r&rjrs rebSetz1IRCUser._setTopic..cbGroup..ebSets)  ,,%**$Dr!)rcopyrintrrUr:)rjnewMetar5rrs` rrz"IRCUser._setTopic..cbGroups^jjoo'G$GG &*iiGN #$'KGL ! $$W-88? ?r!c|jtjjtj ddyr.rr!s rrz"IRCUser._setTopic..ebGroupr0r!)rcrr)rr"rrrs``` rr%zIRCUser._setTopics/ @  w'44WgFr!c|D]4\}}}|jtj|t|d|z6|jtjdy)z Send a group of LIST response lines @type channels: C{list} of C{(str, int, str)} @param channels: Information about the channels being sent: their name, the number of participants, and their topic. rz :End of /LISTN)rrRPL_LISTstr RPL_LISTEND)rchannelsrrKrs rrz IRCUser.listsP"* I D$   S\\4TC%K H I /:r!c:|r |d}t|tr|jj}|j d}g}|D]B}|jdr|dd}|jjj|Dtj|d}|jd njj!}fd }|j|y#t $r'j tj|ddYywxYw) z List query Return information about the indicated channels, or about all channels if none are specified. Parameters: [ *( "," ) [ ] ] r,rNrrT) consumeErrorsc>|Dcgc] \}}|s | c}}Scc}}wr#r\)gssrs rrz"IRCUser.irc_LIST..s2*C!Q1*C*Cs c d}tj|Dcgc]"}|jj||$c}}|jfd|Scc}w)NcR|j||jjdfS)Nr)rrr)rKrjs rgotSizez3IRCUser.irc_LIST..cbGroups..gotSizes zz4)@@@r!c^j|Dcgc] \}}|s | c}}Scc}}wr#)r)r-rDrErs rrz4IRCUser.irc_LIST..cbGroups..s%$))W4R6AqPQQ4R*S4Rs ) ) )r r<rKr=)r`rHrjr@rs rcbGroupsz"IRCUser.irc_LIST..cbGroupssV A""GMNe))'59NA MMS THOs'A)rrrrsplitrrrrrr;rcrr r<r=ru)rrr allChannelsr>r`chrJs` rirc_LISTzIRCUser.irc_LISTs  $Qi k51"-"4"4T]]"CK&,,S1F :==%ABB djj44R89 : ''dCF   C DZZ**,F  8$=&   ))1IG   sAC**-DDc |j|jd|jz|jDcgc]G}|j|j|jj|jdd|jfIc}ycc}w)NrHr)whorrXrrc)rrjms r _channelWhozIRCUser._channelWhosl  II %** *  aP   sA B cD|jtjdy)Nz:User /WHO not implemented)rr RPL_ENDOFWHOrr0s r_userWhozIRCUser._userWhos ))+GHr!c4|s!jtjdy |dttrj j jdrAfd}jjdd}|jj|yfd}jj}|jj|y#t$r'jtj|ddYywxYw) zC Who query Parameters: [ [ "o" ] ] z:/WHO not supported.Nrz2:End of /WHO list (could not decode your unicode!)rc|jtjjtj dyNz:End of /WHO list.)rrrrrrUr&rrs rrz IRCUser.irc_WHO..ebGroup*s.++,  !1!1=BVWr!rc|jtjjtj dyrZ)rr NoSuchUserrrrUr[s rrzIRCUser.irc_WHO..ebUser2s.**+  !1!1=BVWr!)rrrUrrrrrrrcrrrSrrW)rrrrr@rrs` @rirc_WHOzIRCUser.irc_WHO s   S--/E F  "1IM-/ - 4 4T]] C   # #C ( X &&}QR'89A NN4++W 5 X %%m4A NN4==& 1/"      q D    s0C''-DDc<fd}fd} d}t|tr|jj}jj|j||y#t$r'j t jddYywxYw)zV Whois query Parameters: [ ] *( "," ) cjj|j|jjj|jjjddtt |j z |j |jDcgc]}d|jzc} ycc}w)NzHi mom!Fr)whoisrrcr7rrareru)r0rjrs rcbUserz!IRCUser.irc_WHOIS..cbUser@s JJ      DFT---. /3/@Aeuzz!A Bs!B?c|jtjjtj ddy)Nr:No such nick/channel)rrr]rrrrs rrz!IRCUser.irc_WHOIS..ebUserOs2 HHV&& '   S// z:O-lines not applicableN)rrERR_NOOPERHOSTrs rirc_OPERzIRCUser.irc_OPER^s ++-FGr!r#)7rYrZr[__doc__r`rxrrcrrrrr9rDrMrSrrrrrr}rr RPL_WELCOME RPL_YOURHOST RPL_CREATED RPL_MYINFOr RPL_MOTDSTART RPL_ENDOFMOTDrrrrrrrrrr~rrr#r'r r&r%rrNrSrWr^rerhr\r!rrzrzsl FFF EH(  3P " HH # -D #-.N 56    O  HI NN 5  &  FG  45M D (4(? $SL !0F&FP&IP"GH$2 H OG6 ;2%h I.2`"AJHr!rzceZdZdZeZdZy) IRCFactorya IRC server that creates instances of the L{IRCUser} protocol. @ivar _serverInfo: A dictionary mapping: "serviceName" to the name of the server, "serviceVersion" to the copyright version, "creationDate" to the time that the server was started. c||_||_|jjtjt d|_y)N) serviceNameserviceVersion creationDate)rcr rrversionrr)rrcr s rr zIRCFactory.__init__ss3  ::??'//!G r!N)rYrZr[rirzr r r\r!rrqrqgsH r!rqc0eZdZdZdZdZdZdZdZy)PBMindcyr#r\rJs rr zPBMind.__init__~ r!ctjt}t|tr|j d}||j j|fSNr{)rqualrxrr<rinvokerregisterReferencerjellierr}s rjellyForzPBMind.jellyForsB||F# dC ;;w'DW__66t<<W  r!cf|jdt|j|j||S)NrS)rrrcrrs rrSzPBMindReference.groupMetaUpdates+ wtzz4;;F  r!c |jdt|j|j|t |j|j|S)Nr9rrrcrrrs rr9zPBMindReference.userJoineds>  DJJ U 3 4::t{{D 1  r!Nc |jdt|j|j|t |j|j||S)NrDrrs rrDzPBMindReference.userLeftsA  DJJ U 3 4::t{{D 1    r!r#)rYrZr[rrMrSr9rDr\r!rrrs D    r!rc,eZdZdZdZdZddZdZy)rc.||_||_||_yr#)rcrrj)rrcrrjs rr zPBGroup.__init__s   r!ct|jj|jj|jjfSr#)hashrcrrrjrJs rprocessUniqueIDzPBGroup.processUniqueIDs.TZZ__dkk&6&6 HIIr!c,tj|j}t|tr|j d}|j j}t|tr|j d}|||jj|fSr|) rr} __class__rr<rrjrr~r)rrr}rjs rrzPBGroup.jellyForsm||DNN+ dC ;;w'D  eS !LL)EUGOO==dCCCr!NcN|jj|j|Sr#)rrqrjrs r remote_leavezPBGroup.remote_leaves{{  V44r!cN|jj|j|Sr#)rrsrjrrPs r remote_sendzPBGroup.remote_sends{{ G44r!r#)rYrZr[r rrrrr\r!rrrs JD55r!rcFeZdZdZd dZdZdZdZdZd dZ d Z d Z y) PBGroupReferencec|\}}}||_ttk7r:t|jtr |jj d|_t j j||||gSr|)rrr<rrrRemoteReference unjellyFor)r unjellier unjellyListclsNamerrefs rrzPBGroupReference.unjellyFors^(s C.cbGroup..cbJoins t{{00$++uEEr!r)rjrkr@rs` rrz'ChatAvatar.remote_join..cbGroups0 F   'A MM& !Hr!)rrcrr=)rrrr@s` r remote_joinzChatAvatar.remote_joins5  KK   & &y 1 gr!cyr#r\rJs rrzChatAvatar.name r!cyr#r\)rr*s rrzChatAvatar.name$rr!cyr#r\rs rrSzChatAvatar.groupMetaUpdate)rr!cyr#r\rs rrMzChatAvatar.receive-rr!cyr#r\rs rr9zChatAvatar.userJoined1rr!Ncyr#r\rs rrDzChatAvatar.userLeft5rr!r#) rYrZr[r rrpropertyrsetterrSrMr9rDr\r!rrrsQ=    [[      r!rceZdZdZdZy)AvatarReferencec&|jd|S)Nrmr)rrs rrmzAvatarReference.join>svy11r!ctj|jjfd|jjj S)Nc&jdSr#)callback)r@srrz&AvatarReference.quit..Csqzz$/?r!)r DeferredbrokernotifyOnDisconnectrr)rr@s @rquitzAvatarReference.quitAs= NN  &&'?@ ,,.r!N)rYrZr[rmrr\r!rrr=s 2r!rcleZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZy) WordsRealmr{c||_yr#)rrs rr zWordsRealm.__init__Os  r!ct|Sr#)r^rs r userFactoryzWordsRealm.userFactoryRs Dzr!ct|Sr#)rrs r groupFactoryzWordsRealm.groupFactoryUs T{r!cfd}|S)NcHtdddx__y)Nrxcyr#r\r\r!rrz:WordsRealm.logoutFactory..logout..[sr!)getattrrcrd)rfacetsrrxz(WordsRealm.logoutFactory..logoutYs" 2GE8\ 2 4)- -FL6;r!r\)rrrrxs `` r logoutFactoryzWordsRealm.logoutFactoryXs .  r!cttrjjfd}j j |S)Nc|jtjD]K}||d}||j__|_||j ||fcStr#)rcrrrfrrrNotImplementedError)rrravatarId interfacesrdrs r gotAvatarz+WordsRealm.requestAvatar..gotAvatards||',,..# Kfd+$OOD$/ (DI!%DJ"(DK %););FE)JJJ K&dJ7 7r!)rrr _encodinggetUserr=)rrrdrrs```` r requestAvatarzWordsRealm.requestAvatar`s@ h &t~~6H 8||H%11)<.ebGroups&../''--r!)createGroupOnRequest createGroupr:r)rrrs`` rrzWordsRealm.getGroups@  $ $ .##D)44W= =%%r!cjr&fd}jj|SjS)Ncd|jtjjSr#)rr DuplicateUserrrs rrz"WordsRealm.getUser..ebUsers$--.t,,r!)createUserOnRequest createUserr:r)rrrs`` rrzWordsRealm.getUsers<  # # -??4(33F; ;t$$r!cfd}fd}jj}|j|||jj|S)NcTtjtjSr#)r r$rr)r0rs rcbLookupz'WordsRealm.createUser..cbLookups??6#7#7#=> >r!cd|jtjjSr#)rrr]rrs rebLookupz'WordsRealm.createUser..ebLookups& HHV&& '##D) )r!)rrrr=rrrrrr@s`` rrzWordsRealm.createUsersK ? *zz| OOD ! x* dll#r!cfd}fd}jj}|j|||jj|S)NcTtjtjSr#)r r$rr)rjrs rrz(WordsRealm.createGroup..cbLookups??6#8#8#>? ?r!cd|jtjjSr#)rrrrrs rrz(WordsRealm.createGroup..ebLookups& HHV'' ($$T* *r!)rrrr=rrs`` rrzWordsRealm.createGroupsN @ +zz|   T " x* dmm$r!N)rYrZr[rr rrrrrurrrrrrrrrrr\r!rrrKs[I=& !"""" "&%  r!rc<eZdZfdZdZdZdZdZdZxZ S)InMemoryWordsRealmc@t||i|i|_i|_yr#)superr rr`)rarrs rr zInMemoryWordsRealm.__init__s# !"r"  r!c\tj|jjSr#)r r>r`r7rJs rruzInMemoryWordsRealm.itergroupss}}T[[//122r!c|j|jvr:tjt j t jS||j|j<tj|Sr#) rrr failr r$rrr>rVs rrzInMemoryWordsRealm.addUsersT 99 "::goof.B.B.DEF F $ 499}}T""r!c|j|jvr:tjt j t jS||j|j<tj|Sr#) rr`r rr r$rrr>rs rrzInMemoryWordsRealm.addGroupsT :: $::goof.C.C.EFG G"' EJJ}}U##r!c|j} |j|}tj|S#t$r>tj t jtj|cYSwxYwr#) rrr r>rErr r$rr])rrr0s rrzInMemoryWordsRealm.lookupUsersgzz| '::d#D==& & H::goof.?.?.EFG G H6AA=<A=c|j} |j|}tj|S#t$r>tj t jtj|cYSwxYwr#) rr`r r>rErr r$rr)rrrjs rrzInMemoryWordsRealm.lookupGroupsgzz| (KK%E==' ' I::goof.@.@.FGH H Ir) rYrZr[r rurrrr __classcell__)rs@rr r s! 3# $ '(r!r )rr^rr N)6rirrzope.interfacertwistedr twisted.credrrrr twisted.internetr r twisted.pythonr r rtwisted.python.componentsrtwisted.spreadr twisted.wordsrrtwisted.words.protocolsrrrrr^rr4rrz ServerFactoryrq ReferenceablerxrrsetUnjellyableForClassrrrr IPerspectiverIRealm IChatServicerr __all__r\r!rr's' 2&<<,005(' V]]J)J)J)Z V\\%%%P ( V   } Hcgg} H!} H@ '' , R   . V    b(( ! B&/25b52 V]]$ r))$ $ N'#34IR  I V   / !!/ !/ d FLL"//:b((*o6 V]]F//0BB1BJ%(%(P r!