Exemplo n.º 1
0
 def string(self, string):
     if not isinstance(string, basestring):
         string = str(string)
     token = str2tok(string)
     if token is not None:
         return self.token(token)
     elif "@" in string:
         user, at, server = string.partition("@")
         return self.jid(user, server)
     else:
         return self.bytes(string)
Exemplo n.º 2
0
 def string(self, string):
     if not isinstance(string, basestring):
         string = str(string)
     token = str2tok(string)
     if token is not None:
         return self.token(token)
     elif "@" in string:
         user, at, server = string.partition("@")
         return self.jid(user, server)
     else:
         return self.bytes(string)
Exemplo n.º 3
0
    def string(self, string):
        token = str2tok(string)

        if token is not None:
            if token > 0xEB:
                return self.token(0xEC) + self.token(token - 0xED)
            else:
                return self.token(token)
        elif "@" in string:
            user, at, server = string.partition("@")
            return self.jid(user, server)
        else:
            return self.bytes(string)
Exemplo n.º 4
0
    def string(self, string):
        token = str2tok(string)

        if token is not None:
            if token > 0xEB:
                return self.token(0xEC) + self.token(token - 0xED)
            else:
                return self.token(token)
        elif "@" in string:
            user, at, server = string.partition("@")
            return self.jid(user, server)
        else:
            return self.bytes(string)