Ϫf UdZddlmZmZmZddlmZmZmZGdde Z de deee dfe ee dfffd Z d ee dfd e d ee dfdeee dfe ee dfffd Z iZee dfed<dZGddZy)a$ Jabber Identifier support. This module provides an object to represent Jabber Identifiers (JIDs) and parse string representations into them with proper checking for illegal characters, case folding and canonicalisation through L{stringprep}. )DictTupleUnion)nameprepnodeprep resourceprepceZdZdZy) InvalidFormatzT The given string could not be parsed into a valid Jabber Identifier (JID). N)__name__ __module__ __qualname____doc__D/usr/lib/python3/dist-packages/twisted/words/protocols/jabber/jid.pyr r srr jidstringreturnNcLd}d}d}|jd}|jd}|dk(r|dk(r|}nc|d|}||dzdxsd}nQ|dk(r|d|xsd}||dzd}n:||kr$|d|xsd}||dz|||z z}||dzdxsd}n|d|}||dzdxsd}t|||S)a Parse given JID string into its respective parts and apply stringprep. @param jidstring: string representation of a JID. @type jidstring: L{str} @return: tuple of (user, host, resource), each of type L{str} as the parsed and stringprep'd parts of the given JID. If the given string did not have a user or resource part, the respective field in the tuple will hold L{None}. @rtype: L{tuple} N@/r)findprep)ruserhostresourceuser_sepres_seps rparser s  D DH~~c"HnnS!G2~ b=DQw'D 1/74H b=Qx(0DDX\^,D'! 8,4 AGhrLs &%I ,&S,&U5d#3S%T :J#JK,&^(" T (""%("16sDy1A(" 5d S%T "2 23("V"$ d3:# y'y'r