some coding standards

This commit is contained in:
Yann Leboulanger 2010-01-13 10:35:52 +01:00
parent 9782c3f1c0
commit 3238e30359
2 changed files with 10 additions and 11 deletions

View File

@ -1647,8 +1647,8 @@ class Connection(CommonConnection, ConnectionHandlers):
p = common.xmpp.Presence(jid, 'unsubscribe')
self.connection.send(p)
def request_subscription(self, jid, msg = '', name = '', groups = [],
auto_auth = False, user_nick = ''):
def request_subscription(self, jid, msg='', name='', groups=[],
auto_auth=False, user_nick=''):
if not self.connection:
return
log.debug('subscription request for %s' % jid)
@ -1660,7 +1660,7 @@ class Connection(CommonConnection, ConnectionHandlers):
infos['name'] = name
iq = common.xmpp.Iq('set', common.xmpp.NS_ROSTER)
q = iq.getTag('query')
item = q.addChild('item', attrs = infos)
item = q.addChild('item', attrs=infos)
for g in groups:
item.addChild('group').setData(g)
self.connection.send(iq)

View File

@ -133,20 +133,20 @@ class ConnectionDisco:
if not self.connection or self.connected < 2:
return
if is_form:
iq = common.xmpp.Iq('set', common.xmpp.NS_REGISTER, to = agent)
iq = common.xmpp.Iq('set', common.xmpp.NS_REGISTER, to=agent)
query = iq.getTag('query')
info.setAttr('type', 'submit')
query.addChild(node = info)
query.addChild(node=info)
self.connection.SendAndCallForResponse(iq, self._agent_registered_cb,
{'agent': agent})
else:
# fixed: blocking
common.xmpp.features_nb.register(self.connection, agent, info, None)
def _discover(self, ns, jid, node = None, id_prefix = None):
def _discover(self, ns, jid, node=None, id_prefix=None):
if not self.connection or self.connected < 2:
return
iq = common.xmpp.Iq(typ = 'get', to = jid, queryNS = ns)
iq = common.xmpp.Iq(typ='get', to=jid, queryNS=ns)
if id_prefix:
id_ = self.connection.getAnID()
iq.setID('%s%s' % (id_prefix, id_))
@ -167,12 +167,11 @@ class ConnectionDisco:
frm = helpers.get_full_jid_from_iq(iq_obj)
to = unicode(iq_obj.getAttr('to'))
id_ = unicode(iq_obj.getAttr('id'))
iq = common.xmpp.Iq(to = frm, typ = 'result', queryNS =\
common.xmpp.NS_DISCO, frm = to)
iq = common.xmpp.Iq(to=frm, typ='result', queryNS=common.xmpp.NS_DISCO,
frm=to)
iq.setAttr('id', id_)
query = iq.setTag('query')
query.setAttr('node','http://gajim.org#' + gajim.version.split('-',
1)[0])
query.setAttr('node','http://gajim.org#' + gajim.version.split('-', 1)[0])
for f in (common.xmpp.NS_BYTESTREAM, common.xmpp.NS_SI,
common.xmpp.NS_FILE, common.xmpp.NS_COMMANDS):
feature = common.xmpp.Node('feature')