示例#1
0
 def __init__(self, errorCondition=None, errorType=None):
     super(StanzaErrorExtension, self).__init__(_TAG.ERROR)
     if errorCondition:
         if not errorCondition in STANZA_ERRORS:
             raise AssertionError
             codeExt = PyExtension(errorCondition)
             codeExt.setXmlNs(_NS.STANZA_ERROR)
             self.setChild(codeExt)
             if not errorType:
                 errorType = STANZA_ERRORS[errorCondition]
         errorType and self.setAttribute("type", errorType)
示例#2
0
文件: error.py 项目: kblw/wot_client
 def __init__(self, errorCondition = None, errorType = None):
     super(StanzaErrorExtension, self).__init__(_TAG.ERROR)
     if errorCondition:
         assert errorCondition in STANZA_ERRORS
         codeExt = PyExtension(errorCondition)
         codeExt.setXmlNs(_NS.STANZA_ERROR)
         self.setChild(codeExt)
         if not errorType:
             errorType = STANZA_ERRORS[errorCondition]
     if errorType:
         self.setAttribute('type', errorType)
示例#3
0
文件: search.py 项目: kblw/wot_client
 def __initExtension(self):
     filterExtension = PyExtension(_TAG.FILTER).setXmlNs(_NS.WG_MUC_ROOMS).setAttribute('roomname-prefix', self._token).setAttribute('max-entries', self._results_count)
     filterExtension.setChild(_SimpleCriterionExtension('muc#roomconfig_membersonly', 0))
     return PyExtension(_TAG.QUERY).setXmlNs(_NS.DISCO_ITEMS).setChild(filterExtension)
示例#4
0
 def __init__(self):
     super(ChannelsListHandler, self).__init__(
         PyExtension(_TAG.QUERY).setXmlNs(_NS.DISCO_ITEMS).setChild(
             ChannelItemExtension()))
示例#5
0
 def __initExtension(self):
     filterExtension = PyExtension(_TAG.ITEM).setXmlNs(
         _NS.WG_SPA_RESOLVER).setAttribute('nickname', self._nickname)
     return PyExtension(_TAG.QUERY).setXmlNs(
         _NS.WG_SPA_RESOLVER).setChild(filterExtension)
示例#6
0
def _createUnblockItemExt(jid=None):
    return PyExtension(_TAG.UNBLOCK_ITEM).setXmlNs(_NS.BLOCKING_CMD).setChild(
        ContactItemExtension(jid))
示例#7
0
def _createBlockListExt():
    return PyExtension(_TAG.BLOCK_LIST).setXmlNs(_NS.BLOCKING_CMD)
示例#8
0
 def __init__(self):
     super(NicknamePrefixSearchHandler, self).__init__(
         PyExtension(_TAG.WG_NICKNAME_PREFIX_SEARCH).setXmlNs(
             _NS.WG_SPA_RESOLVER).setChild(UserSearchItemExtension()))
示例#9
0
 def __initExtension(self):
     return PyExtension(_TAG.WG_NICKNAME_PREFIX_SEARCH).setXmlNs(
         _NS.WG_SPA_RESOLVER).setAttribute('prefix',
                                           self._prefix).setAttribute(
                                               'limit', self._limit)
示例#10
0
 def __init__(self):
     super(UserSearchHandler, self).__init__(
         PyExtension(_TAG.QUERY).setXmlNs(_NS.WG_SPA_RESOLVER).setChild(
             UserSearchItemExtension()))