misc: replaced all "dummy" by the more conventional and readable "__" ("_" being used for gettext)
This commit is contained in:
parent
fa0179f87e
commit
7a9ee35cfc
56 changed files with 215 additions and 215 deletions
|
|
@ -58,7 +58,7 @@ class EmbeddedConstructor(base_constructor.Constructor):
|
||||||
|
|
||||||
if async_:
|
if async_:
|
||||||
completion["cb_or_lambda"] = (
|
completion["cb_or_lambda"] = (
|
||||||
"callback" if function["sig_out"] else "lambda dummy: callback()"
|
"callback" if function["sig_out"] else "lambda __: callback()"
|
||||||
)
|
)
|
||||||
completion[
|
completion[
|
||||||
"ret_routine"
|
"ret_routine"
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ class _Bridge(object):
|
||||||
if async_:
|
if async_:
|
||||||
d = self._methods_cbs[name](*args, **kwargs)
|
d = self._methods_cbs[name](*args, **kwargs)
|
||||||
if callback is not None:
|
if callback is not None:
|
||||||
d.addCallback(callback if out_sign else lambda dummy: callback())
|
d.addCallback(callback if out_sign else lambda __: callback())
|
||||||
if errback is None:
|
if errback is None:
|
||||||
d.addErrback(lambda failure_: log.error(failure_))
|
d.addErrback(lambda failure_: log.error(failure_))
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ class pbConstructor(base_constructor.Constructor):
|
||||||
"args_no_def": self.getArguments(function["sig_in"], name=arg_doc),
|
"args_no_def": self.getArguments(function["sig_in"], name=arg_doc),
|
||||||
"callback": "callback"
|
"callback": "callback"
|
||||||
if function["sig_out"]
|
if function["sig_out"]
|
||||||
else "lambda dummy: callback()",
|
else "lambda __: callback()",
|
||||||
"debug": ""
|
"debug": ""
|
||||||
if not self.args.debug
|
if not self.args.debug
|
||||||
else 'log.debug ("%s")\n%s' % (completion["name"], 8 * " "),
|
else 'log.debug ("%s")\n%s' % (completion["name"], 8 * " "),
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ class Bridge(object):
|
||||||
reactor.connectTCP("localhost", 8789, factory)
|
reactor.connectTCP("localhost", 8789, factory)
|
||||||
d = factory.getRootObject()
|
d = factory.getRootObject()
|
||||||
d.addCallback(self._set_root)
|
d.addCallback(self._set_root)
|
||||||
d.addCallback(lambda dummy: callback())
|
d.addCallback(lambda __: callback())
|
||||||
d.addErrback(errback)
|
d.addErrback(errback)
|
||||||
|
|
||||||
def register_signal(self, functionName, handler, iface="core"):
|
def register_signal(self, functionName, handler, iface="core"):
|
||||||
|
|
|
||||||
|
|
@ -411,7 +411,7 @@ class SAT(service.Service):
|
||||||
if options is None:
|
if options is None:
|
||||||
options = {}
|
options = {}
|
||||||
|
|
||||||
def connectProfile(dummy=None):
|
def connectProfile(__=None):
|
||||||
if self.isConnected(profile):
|
if self.isConnected(profile):
|
||||||
log.info(_("already connected !"))
|
log.info(_("already connected !"))
|
||||||
return True
|
return True
|
||||||
|
|
@ -420,7 +420,7 @@ class SAT(service.Service):
|
||||||
d = xmpp.SatXMPPComponent.startConnection(self, profile, max_retries)
|
d = xmpp.SatXMPPComponent.startConnection(self, profile, max_retries)
|
||||||
else:
|
else:
|
||||||
d = xmpp.SatXMPPClient.startConnection(self, profile, max_retries)
|
d = xmpp.SatXMPPClient.startConnection(self, profile, max_retries)
|
||||||
return d.addCallback(lambda dummy: False)
|
return d.addCallback(lambda __: False)
|
||||||
|
|
||||||
d = self.memory.startSession(password, profile)
|
d = self.memory.startSession(password, profile)
|
||||||
d.addCallback(connectProfile)
|
d.addCallback(connectProfile)
|
||||||
|
|
@ -492,7 +492,7 @@ class SAT(service.Service):
|
||||||
def getContacts(self, profile_key):
|
def getContacts(self, profile_key):
|
||||||
client = self.getClient(profile_key)
|
client = self.getClient(profile_key)
|
||||||
|
|
||||||
def got_roster(dummy):
|
def got_roster(__):
|
||||||
ret = []
|
ret = []
|
||||||
for item in client.roster.getItems(): # we get all items for client's roster
|
for item in client.roster.getItems(): # we get all items for client's roster
|
||||||
# and convert them to expected format
|
# and convert them to expected format
|
||||||
|
|
@ -1032,7 +1032,7 @@ class SAT(service.Service):
|
||||||
progress_all[profile] = progress_dict
|
progress_all[profile] = progress_dict
|
||||||
for (
|
for (
|
||||||
progress_id,
|
progress_id,
|
||||||
(dummy, progress_metadata),
|
(__, progress_metadata),
|
||||||
) in client._progress_cb.iteritems():
|
) in client._progress_cb.iteritems():
|
||||||
progress_dict[progress_id] = progress_metadata
|
progress_dict[progress_id] = progress_metadata
|
||||||
return progress_all
|
return progress_all
|
||||||
|
|
@ -1052,7 +1052,7 @@ class SAT(service.Service):
|
||||||
profile = client.profile
|
profile = client.profile
|
||||||
progress_dict = {}
|
progress_dict = {}
|
||||||
progress_all[profile] = progress_dict
|
progress_all[profile] = progress_dict
|
||||||
for progress_id, (progress_cb, dummy) in client._progress_cb.iteritems():
|
for progress_id, (progress_cb, __) in client._progress_cb.iteritems():
|
||||||
progress_dict[progress_id] = progress_cb(progress_id, profile)
|
progress_dict[progress_id] = progress_cb(progress_id, profile)
|
||||||
return progress_all
|
return progress_all
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ class Discovery(object):
|
||||||
|
|
||||||
d = self.getItems(client, jid_)
|
d = self.getItems(client, jid_)
|
||||||
d.addCallback(gotItems)
|
d.addCallback(gotItems)
|
||||||
d.addCallback(lambda dummy: found_entities)
|
d.addCallback(lambda __: found_entities)
|
||||||
reactor.callLater(
|
reactor.callLater(
|
||||||
TIMEOUT, d.cancel
|
TIMEOUT, d.cancel
|
||||||
) # FIXME: one bad service make a general timeout
|
) # FIXME: one bad service make a general timeout
|
||||||
|
|
@ -338,7 +338,7 @@ class Discovery(object):
|
||||||
|
|
||||||
d = self.getItems(client, jid_)
|
d = self.getItems(client, jid_)
|
||||||
d.addCallback(gotItems)
|
d.addCallback(gotItems)
|
||||||
d.addCallback(lambda dummy: found_entities)
|
d.addCallback(lambda __: found_entities)
|
||||||
reactor.callLater(
|
reactor.callLater(
|
||||||
TIMEOUT, d.cancel
|
TIMEOUT, d.cancel
|
||||||
) # FIXME: one bad service make a general timeout
|
) # FIXME: one bad service make a general timeout
|
||||||
|
|
|
||||||
|
|
@ -353,14 +353,14 @@ class Memory(object):
|
||||||
"""
|
"""
|
||||||
profile = self.getProfileName(profile)
|
profile = self.getProfileName(profile)
|
||||||
|
|
||||||
def createSession(dummy):
|
def createSession(__):
|
||||||
"""Called once params are loaded."""
|
"""Called once params are loaded."""
|
||||||
self._entities_cache[profile] = {}
|
self._entities_cache[profile] = {}
|
||||||
log.info(u"[{}] Profile session started".format(profile))
|
log.info(u"[{}] Profile session started".format(profile))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def backendInitialised(dummy):
|
def backendInitialised(__):
|
||||||
def doStartSession(dummy=None):
|
def doStartSession(__=None):
|
||||||
if self.isSessionStarted(profile):
|
if self.isSessionStarted(profile):
|
||||||
log.info("Session already started!")
|
log.info("Session already started!")
|
||||||
return True
|
return True
|
||||||
|
|
@ -558,7 +558,7 @@ class Memory(object):
|
||||||
|
|
||||||
d = self.params.createProfile(name, component)
|
d = self.params.createProfile(name, component)
|
||||||
|
|
||||||
def initPersonalKey(dummy):
|
def initPersonalKey(__):
|
||||||
# be sure to call this after checking that the profile doesn't exist yet
|
# be sure to call this after checking that the profile doesn't exist yet
|
||||||
personal_key = BlockCipher.getRandomKey(
|
personal_key = BlockCipher.getRandomKey(
|
||||||
base64=True
|
base64=True
|
||||||
|
|
@ -567,24 +567,24 @@ class Memory(object):
|
||||||
{C.MEMORY_CRYPTO_KEY: personal_key}, profile=name
|
{C.MEMORY_CRYPTO_KEY: personal_key}, profile=name
|
||||||
) # will be encrypted by setParam
|
) # will be encrypted by setParam
|
||||||
|
|
||||||
def startFakeSession(dummy):
|
def startFakeSession(__):
|
||||||
# avoid ProfileNotConnected exception in setParam
|
# avoid ProfileNotConnected exception in setParam
|
||||||
self._entities_cache[name] = None
|
self._entities_cache[name] = None
|
||||||
self.params.loadIndParams(name)
|
self.params.loadIndParams(name)
|
||||||
|
|
||||||
def stopFakeSession(dummy):
|
def stopFakeSession(__):
|
||||||
del self._entities_cache[name]
|
del self._entities_cache[name]
|
||||||
self.params.purgeProfile(name)
|
self.params.purgeProfile(name)
|
||||||
|
|
||||||
d.addCallback(initPersonalKey)
|
d.addCallback(initPersonalKey)
|
||||||
d.addCallback(startFakeSession)
|
d.addCallback(startFakeSession)
|
||||||
d.addCallback(
|
d.addCallback(
|
||||||
lambda dummy: self.setParam(
|
lambda __: self.setParam(
|
||||||
C.PROFILE_PASS_PATH[1], password, C.PROFILE_PASS_PATH[0], profile_key=name
|
C.PROFILE_PASS_PATH[1], password, C.PROFILE_PASS_PATH[0], profile_key=name
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
d.addCallback(stopFakeSession)
|
d.addCallback(stopFakeSession)
|
||||||
d.addCallback(lambda dummy: self.auth_sessions.profileDelUnique(name))
|
d.addCallback(lambda __: self.auth_sessions.profileDelUnique(name))
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def asyncDeleteProfile(self, name, force=False):
|
def asyncDeleteProfile(self, name, force=False):
|
||||||
|
|
@ -596,7 +596,7 @@ class Memory(object):
|
||||||
@return: a Deferred instance
|
@return: a Deferred instance
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def cleanMemory(dummy):
|
def cleanMemory(__):
|
||||||
self.auth_sessions.profileDelUnique(name)
|
self.auth_sessions.profileDelUnique(name)
|
||||||
try:
|
try:
|
||||||
del self._entities_cache[name]
|
del self._entities_cache[name]
|
||||||
|
|
@ -1100,7 +1100,7 @@ class Memory(object):
|
||||||
|
|
||||||
return d.addCallback(cb)
|
return d.addCallback(cb)
|
||||||
|
|
||||||
def done(dummy):
|
def done(__):
|
||||||
log.debug(
|
log.debug(
|
||||||
_(u"Personal data (%(ns)s, %(key)s) has been successfuly encrypted")
|
_(u"Personal data (%(ns)s, %(key)s) has been successfuly encrypted")
|
||||||
% {"ns": C.MEMORY_CRYPTO_NAMESPACE, "key": data_key}
|
% {"ns": C.MEMORY_CRYPTO_NAMESPACE, "key": data_key}
|
||||||
|
|
|
||||||
|
|
@ -294,7 +294,7 @@ class Params(object):
|
||||||
if (
|
if (
|
||||||
len(cat_node.childNodes) == to_remove_count
|
len(cat_node.childNodes) == to_remove_count
|
||||||
): # remove empty category
|
): # remove empty category
|
||||||
for dummy in xrange(0, to_remove_count):
|
for __ in xrange(0, to_remove_count):
|
||||||
to_remove.pop()
|
to_remove.pop()
|
||||||
to_remove.append(cat_node)
|
to_remove.append(cat_node)
|
||||||
for node in to_remove:
|
for node in to_remove:
|
||||||
|
|
@ -714,7 +714,7 @@ class Params(object):
|
||||||
|
|
||||||
prof_xml.unlink()
|
prof_xml.unlink()
|
||||||
dlist = defer.gatherResults(names_d_list)
|
dlist = defer.gatherResults(names_d_list)
|
||||||
dlist.addCallback(lambda dummy: ret)
|
dlist.addCallback(lambda __: ret)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
d = self._constructProfileXml(security_limit, "", profile)
|
d = self._constructProfileXml(security_limit, "", profile)
|
||||||
|
|
@ -1071,7 +1071,7 @@ class Params(object):
|
||||||
profile=profile,
|
profile=profile,
|
||||||
)
|
)
|
||||||
d.addCallback(
|
d.addCallback(
|
||||||
lambda dummy: PasswordHasher.hash(value)
|
lambda __: PasswordHasher.hash(value)
|
||||||
) # profile password is hashed (empty value stays empty)
|
) # profile password is hashed (empty value stays empty)
|
||||||
elif value: # other non empty passwords are encrypted with the personal key
|
elif value: # other non empty passwords are encrypted with the personal key
|
||||||
d = BlockCipher.encrypt(personal_key, value)
|
d = BlockCipher.encrypt(personal_key, value)
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ class PersistentDict(object):
|
||||||
"""
|
"""
|
||||||
d = self.storage.getPrivates(self.namespace, binary=self.binary, profile=self.profile)
|
d = self.storage.getPrivates(self.namespace, binary=self.binary, profile=self.profile)
|
||||||
d.addCallback(self._setCache)
|
d.addCallback(self._setCache)
|
||||||
d.addCallback(lambda dummy: self)
|
d.addCallback(lambda __: self)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def iteritems(self):
|
def iteritems(self):
|
||||||
|
|
|
||||||
|
|
@ -289,7 +289,7 @@ class SqliteStorage(object):
|
||||||
def setComponent(profile_id):
|
def setComponent(profile_id):
|
||||||
id_ = profile_id[0][0]
|
id_ = profile_id[0][0]
|
||||||
d_comp = self.dbpool.runQuery("INSERT INTO components(profile_id, entry_point) VALUES (?, ?)", (id_, component))
|
d_comp = self.dbpool.runQuery("INSERT INTO components(profile_id, entry_point) VALUES (?, ?)", (id_, component))
|
||||||
d_comp.addCallback(lambda dummy: profile_id)
|
d_comp.addCallback(lambda __: profile_id)
|
||||||
return d_comp
|
return d_comp
|
||||||
|
|
||||||
def profile_created(profile_id):
|
def profile_created(profile_id):
|
||||||
|
|
@ -401,7 +401,7 @@ class SqliteStorage(object):
|
||||||
|
|
||||||
## History
|
## History
|
||||||
|
|
||||||
def _addToHistoryCb(self, dummy, data):
|
def _addToHistoryCb(self, __, data):
|
||||||
# Message metadata were successfuly added to history
|
# Message metadata were successfuly added to history
|
||||||
# now we can add message and subject
|
# now we can add message and subject
|
||||||
uid = data['uid']
|
uid = data['uid']
|
||||||
|
|
@ -409,7 +409,7 @@ class SqliteStorage(object):
|
||||||
for lang, value in data[key].iteritems():
|
for lang, value in data[key].iteritems():
|
||||||
d = self.dbpool.runQuery("INSERT INTO {key}(history_uid, {key}, language) VALUES (?,?,?)".format(key=key),
|
d = self.dbpool.runQuery("INSERT INTO {key}(history_uid, {key}, language) VALUES (?,?,?)".format(key=key),
|
||||||
(uid, value, lang or None))
|
(uid, value, lang or None))
|
||||||
d.addErrback(lambda dummy: log.error(_(u"Can't save following {key} in history (uid: {uid}, lang:{lang}): {value}".format(
|
d.addErrback(lambda __: log.error(_(u"Can't save following {key} in history (uid: {uid}, lang:{lang}): {value}".format(
|
||||||
key=key, uid=uid, lang=lang, value=value))))
|
key=key, uid=uid, lang=lang, value=value))))
|
||||||
try:
|
try:
|
||||||
thread = data['extra']['thread']
|
thread = data['extra']['thread']
|
||||||
|
|
@ -419,7 +419,7 @@ class SqliteStorage(object):
|
||||||
thread_parent = data['extra'].get('thread_parent')
|
thread_parent = data['extra'].get('thread_parent')
|
||||||
d = self.dbpool.runQuery("INSERT INTO thread(history_uid, thread_id, parent_id) VALUES (?,?,?)",
|
d = self.dbpool.runQuery("INSERT INTO thread(history_uid, thread_id, parent_id) VALUES (?,?,?)",
|
||||||
(uid, thread, thread_parent))
|
(uid, thread, thread_parent))
|
||||||
d.addErrback(lambda dummy: log.error(_(u"Can't save following thread in history (uid: {uid}): thread:{thread}), parent:{parent}".format(
|
d.addErrback(lambda __: log.error(_(u"Can't save following thread in history (uid: {uid}): thread:{thread}), parent:{parent}".format(
|
||||||
uid=uid, thread=thread, parent=thread_parent))))
|
uid=uid, thread=thread, parent=thread_parent))))
|
||||||
|
|
||||||
def _addToHistoryEb(self, failure_, data):
|
def _addToHistoryEb(self, failure_, data):
|
||||||
|
|
@ -1362,7 +1362,7 @@ class Updater(object):
|
||||||
if rows:
|
if rows:
|
||||||
log.info("fixing duplicate timestamp")
|
log.info("fixing duplicate timestamp")
|
||||||
fixed = []
|
fixed = []
|
||||||
for timestamp, dummy in rows:
|
for timestamp, __ in rows:
|
||||||
ids_rows = yield self.dbpool.runQuery("SELECT id from history where timestamp=?", (timestamp,))
|
ids_rows = yield self.dbpool.runQuery("SELECT id from history where timestamp=?", (timestamp,))
|
||||||
for idx, (id_,) in enumerate(ids_rows):
|
for idx, (id_,) in enumerate(ids_rows):
|
||||||
fixed.append(id_)
|
fixed.append(id_)
|
||||||
|
|
@ -1486,7 +1486,7 @@ class Updater(object):
|
||||||
list_.append(d)
|
list_.append(d)
|
||||||
|
|
||||||
d_list = defer.DeferredList(list_)
|
d_list = defer.DeferredList(list_)
|
||||||
d_list.addCallback(lambda dummy: ret)
|
d_list.addCallback(lambda __: ret)
|
||||||
return d_list
|
return d_list
|
||||||
|
|
||||||
def updateLiberviaConf(values):
|
def updateLiberviaConf(values):
|
||||||
|
|
@ -1507,6 +1507,6 @@ class Updater(object):
|
||||||
|
|
||||||
d = self.dbpool.runQuery("SELECT id FROM profiles WHERE name='libervia'")
|
d = self.dbpool.runQuery("SELECT id FROM profiles WHERE name='libervia'")
|
||||||
d.addCallback(updateLiberviaConf)
|
d.addCallback(updateLiberviaConf)
|
||||||
d.addCallback(lambda dummy: self.dbpool.runQuery("SELECT profile_id,value FROM param_ind WHERE category=? AND name=?", xmpp_pass_path))
|
d.addCallback(lambda __: self.dbpool.runQuery("SELECT profile_id,value FROM param_ind WHERE category=? AND name=?", xmpp_pass_path))
|
||||||
d.addCallback(encrypt_values)
|
d.addCallback(encrypt_values)
|
||||||
return d
|
return d
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ class BlogImportPlugin(object):
|
||||||
filename = filename.replace(
|
filename = filename.replace(
|
||||||
u"%", u"_"
|
u"%", u"_"
|
||||||
) # FIXME: tmp workaround for a bug in prosody http upload
|
) # FIXME: tmp workaround for a bug in prosody http upload
|
||||||
dummy, download_d = yield self._u.upload(
|
__, download_d = yield self._u.upload(
|
||||||
client, tmp_file, filename, options=upload_options
|
client, tmp_file, filename, options=upload_options
|
||||||
)
|
)
|
||||||
download_url = yield download_d
|
download_url = yield download_d
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ class FileSharing(object):
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _fileTransferedCb(self, dummy, client, peer_jid, file_data, file_path):
|
def _fileTransferedCb(self, __, client, peer_jid, file_data, file_path):
|
||||||
"""post file reception tasks
|
"""post file reception tasks
|
||||||
|
|
||||||
on file is received, this method create hash/thumbnails if necessary
|
on file is received, this method create hash/thumbnails if necessary
|
||||||
|
|
|
||||||
|
|
@ -612,7 +612,7 @@ class Events(object):
|
||||||
# first we authorize our invitee to see the nodes of interest
|
# first we authorize our invitee to see the nodes of interest
|
||||||
yield self._p.setNodeAffiliations(client, service, node, {invitee_jid: u"member"})
|
yield self._p.setNodeAffiliations(client, service, node, {invitee_jid: u"member"})
|
||||||
log.debug(_(u"affiliation set on event node"))
|
log.debug(_(u"affiliation set on event node"))
|
||||||
dummy, event_data = yield self.eventGet(client, service, node, item_id)
|
__, event_data = yield self.eventGet(client, service, node, item_id)
|
||||||
log.debug(_(u"got event data"))
|
log.debug(_(u"got event data"))
|
||||||
invitees_service = jid.JID(event_data["invitees_service"])
|
invitees_service = jid.JID(event_data["invitees_service"])
|
||||||
invitees_node = event_data["invitees_node"]
|
invitees_node = event_data["invitees_node"]
|
||||||
|
|
@ -625,7 +625,7 @@ class Events(object):
|
||||||
yield self._p.setNodeAffiliations(
|
yield self._p.setNodeAffiliations(
|
||||||
client, blog_service, blog_node, {invitee_jid: u"member"}
|
client, blog_service, blog_node, {invitee_jid: u"member"}
|
||||||
)
|
)
|
||||||
blog_items, dummy = yield self._b.mbGet(client, blog_service, blog_node, None)
|
blog_items, __ = yield self._b.mbGet(client, blog_service, blog_node, None)
|
||||||
|
|
||||||
for item in blog_items:
|
for item in blog_items:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -291,7 +291,7 @@ class JingleStream(object):
|
||||||
log.warning(u"FIXME: unmanaged action {}".format(action))
|
log.warning(u"FIXME: unmanaged action {}".format(action))
|
||||||
return desc_elt
|
return desc_elt
|
||||||
|
|
||||||
def _finishedCb(self, dummy, client, session, content_name, content_data):
|
def _finishedCb(self, __, client, session, content_name, content_data):
|
||||||
log.info(u"Pipe transfer completed")
|
log.info(u"Pipe transfer completed")
|
||||||
self._j.contentTerminate(client, session, content_name)
|
self._j.contentTerminate(client, session, content_name)
|
||||||
content_data["stream_object"].stopStream()
|
content_data["stream_object"].stopStream()
|
||||||
|
|
|
||||||
|
|
@ -121,8 +121,8 @@ class MercurialHandler(object):
|
||||||
|
|
||||||
def check(self, repository):
|
def check(self, repository):
|
||||||
d = MercurialProtocol.run(repository, 'identify')
|
d = MercurialProtocol.run(repository, 'identify')
|
||||||
d.addCallback(lambda dummy: True)
|
d.addCallback(lambda __: True)
|
||||||
d.addErrback(lambda dummy: False)
|
d.addErrback(lambda __: False)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def export(self, repository):
|
def export(self, repository):
|
||||||
|
|
|
||||||
|
|
@ -225,7 +225,7 @@ class MiscAccount(object):
|
||||||
@return Deferred
|
@return Deferred
|
||||||
"""
|
"""
|
||||||
d = self.createProfile(password, jid_s, profile)
|
d = self.createProfile(password, jid_s, profile)
|
||||||
d.addCallback(lambda dummy: self.sendEmails(email, profile))
|
d.addCallback(lambda __: self.sendEmails(email, profile))
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def createProfile(self, password, jid_s, profile):
|
def createProfile(self, password, jid_s, profile):
|
||||||
|
|
@ -246,7 +246,7 @@ class MiscAccount(object):
|
||||||
return defer.fail(Failure(exceptions.ConflictError))
|
return defer.fail(Failure(exceptions.ConflictError))
|
||||||
|
|
||||||
d = self.host.memory.createProfile(profile, password)
|
d = self.host.memory.createProfile(profile, password)
|
||||||
d.addCallback(lambda dummy: self.profileCreated(password, jid_s, profile))
|
d.addCallback(lambda __: self.profileCreated(password, jid_s, profile))
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def profileCreated(self, password, jid_s, profile):
|
def profileCreated(self, password, jid_s, profile):
|
||||||
|
|
@ -267,7 +267,7 @@ class MiscAccount(object):
|
||||||
jid_ = jid.JID(jid_s)
|
jid_ = jid.JID(jid_s)
|
||||||
d = self.host.plugins["XEP-0077"].registerNewAccount(jid_, password)
|
d = self.host.plugins["XEP-0077"].registerNewAccount(jid_, password)
|
||||||
|
|
||||||
def setParams(dummy):
|
def setParams(__):
|
||||||
self.host.memory.setParam(
|
self.host.memory.setParam(
|
||||||
"JabberID", jid_s, "Connection", profile_key=profile
|
"JabberID", jid_s, "Connection", profile_key=profile
|
||||||
)
|
)
|
||||||
|
|
@ -280,9 +280,9 @@ class MiscAccount(object):
|
||||||
self.host.memory.asyncDeleteProfile(profile)
|
self.host.memory.asyncDeleteProfile(profile)
|
||||||
return failure
|
return failure
|
||||||
|
|
||||||
d.addCallback(lambda dummy: self.host.memory.startSession(password, profile))
|
d.addCallback(lambda __: self.host.memory.startSession(password, profile))
|
||||||
d.addCallback(setParams)
|
d.addCallback(setParams)
|
||||||
d.addCallback(lambda dummy: self.host.memory.stopSession(profile))
|
d.addCallback(lambda __: self.host.memory.stopSession(profile))
|
||||||
d.addErrback(removeProfile)
|
d.addErrback(removeProfile)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
|
|
@ -317,12 +317,12 @@ class MiscAccount(object):
|
||||||
|
|
||||||
admins_emails_txt = u", ".join([u"<" + addr + u">" for addr in admins_emails])
|
admins_emails_txt = u", ".join([u"<" + addr + u">" for addr in admins_emails])
|
||||||
d_admin.addCallbacks(
|
d_admin.addCallbacks(
|
||||||
lambda dummy: log.debug(
|
lambda __: log.debug(
|
||||||
u"Account creation notification sent to admin(s) {}".format(
|
u"Account creation notification sent to admin(s) {}".format(
|
||||||
admins_emails_txt
|
admins_emails_txt
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
lambda dummy: log.error(
|
lambda __: log.error(
|
||||||
u"Failed to send account creation notification to admin {}".format(
|
u"Failed to send account creation notification to admin {}".format(
|
||||||
admins_emails_txt
|
admins_emails_txt
|
||||||
)
|
)
|
||||||
|
|
@ -343,7 +343,7 @@ class MiscAccount(object):
|
||||||
# FIXME: delete the profile if the email could not been sent?
|
# FIXME: delete the profile if the email could not been sent?
|
||||||
d_user = sat_email.sendEmail(self.host, [email], subject, body)
|
d_user = sat_email.sendEmail(self.host, [email], subject, body)
|
||||||
d_user.addCallbacks(
|
d_user.addCallbacks(
|
||||||
lambda dummy: log.debug(
|
lambda __: log.debug(
|
||||||
u"Account creation confirmation sent to <{}>".format(email)
|
u"Account creation confirmation sent to <{}>".format(email)
|
||||||
),
|
),
|
||||||
self._sendEmailEb,
|
self._sendEmailEb,
|
||||||
|
|
@ -485,7 +485,7 @@ class MiscAccount(object):
|
||||||
@param password (str): the new password
|
@param password (str): the new password
|
||||||
@param profile (str): %(doc_profile)s
|
@param profile (str): %(doc_profile)s
|
||||||
"""
|
"""
|
||||||
session_id, dummy = self._sessions.newSession(
|
session_id, __ = self._sessions.newSession(
|
||||||
{"new_password": password}, profile=profile
|
{"new_password": password}, profile=profile
|
||||||
)
|
)
|
||||||
form_ui = xml_tools.XMLUI(
|
form_ui = xml_tools.XMLUI(
|
||||||
|
|
@ -511,7 +511,7 @@ class MiscAccount(object):
|
||||||
password = self._sessions.profileGet(data["session_id"], profile)["new_password"]
|
password = self._sessions.profileGet(data["session_id"], profile)["new_password"]
|
||||||
del self._sessions[data["session_id"]]
|
del self._sessions[data["session_id"]]
|
||||||
|
|
||||||
def passwordChanged(dummy):
|
def passwordChanged(__):
|
||||||
d = self.host.memory.setParam(
|
d = self.host.memory.setParam(
|
||||||
C.PROFILE_PASS_PATH[1],
|
C.PROFILE_PASS_PATH[1],
|
||||||
password,
|
password,
|
||||||
|
|
@ -519,7 +519,7 @@ class MiscAccount(object):
|
||||||
profile_key=profile,
|
profile_key=profile,
|
||||||
)
|
)
|
||||||
d.addCallback(
|
d.addCallback(
|
||||||
lambda dummy: self.host.memory.setParam(
|
lambda __: self.host.memory.setParam(
|
||||||
"Password", password, "Connection", profile_key=profile
|
"Password", password, "Connection", profile_key=profile
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -576,7 +576,7 @@ class MiscAccount(object):
|
||||||
"""
|
"""
|
||||||
client = self.host.getClient(profile)
|
client = self.host.getClient(profile)
|
||||||
|
|
||||||
def userDeleted(dummy):
|
def userDeleted(__):
|
||||||
|
|
||||||
# FIXME: client should be disconnected at this point, so 2 next loop should be removed (to be confirmed)
|
# FIXME: client should be disconnected at this point, so 2 next loop should be removed (to be confirmed)
|
||||||
for jid_ in client.roster._jids: # empty roster
|
for jid_ in client.roster._jids: # empty roster
|
||||||
|
|
@ -594,7 +594,7 @@ class MiscAccount(object):
|
||||||
d = self.host.plugins["GROUPBLOG"].deleteAllGroupBlogsAndComments(
|
d = self.host.plugins["GROUPBLOG"].deleteAllGroupBlogsAndComments(
|
||||||
profile_key=profile
|
profile_key=profile
|
||||||
)
|
)
|
||||||
d.addCallback(lambda dummy: delete_profile())
|
d.addCallback(lambda __: delete_profile())
|
||||||
else:
|
else:
|
||||||
delete_profile()
|
delete_profile()
|
||||||
|
|
||||||
|
|
@ -739,7 +739,7 @@ class MiscAccount(object):
|
||||||
|
|
||||||
d = self.createProfile(password, jid_s, jid_s)
|
d = self.createProfile(password, jid_s, jid_s)
|
||||||
d.addCallback(
|
d.addCallback(
|
||||||
lambda dummy: self.host.memory.getProfileName(jid_s)
|
lambda __: self.host.memory.getProfileName(jid_s)
|
||||||
) # checks if the profile has been successfuly created
|
) # checks if the profile has been successfuly created
|
||||||
d.addCallback(self.host.connect, password, {}, 0)
|
d.addCallback(self.host.connect, password, {}, 0)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ class NatPort(object):
|
||||||
@return (None, str): found IP address, or None of something got wrong
|
@return (None, str): found IP address, or None of something got wrong
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def getIP(dummy):
|
def getIP(__):
|
||||||
if self._upnp is None:
|
if self._upnp is None:
|
||||||
return None
|
return None
|
||||||
# lanaddr can be the empty string if not found,
|
# lanaddr can be the empty string if not found,
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ class RegisterAccount(object):
|
||||||
|
|
||||||
session_data["user"], host, resource = jid.parse(session_data["JabberID"])
|
session_data["user"], host, resource = jid.parse(session_data["JabberID"])
|
||||||
session_data["server"] = session_data[C.FORCE_SERVER_PARAM] or host
|
session_data["server"] = session_data[C.FORCE_SERVER_PARAM] or host
|
||||||
session_id, dummy = self._sessions.newSession(session_data, profile=profile)
|
session_id, __ = self._sessions.newSession(session_data, profile=profile)
|
||||||
form_ui = xml_tools.XMLUI(
|
form_ui = xml_tools.XMLUI(
|
||||||
"form",
|
"form",
|
||||||
title=D_("Register new account"),
|
title=D_("Register new account"),
|
||||||
|
|
@ -129,7 +129,7 @@ class RegisterAccount(object):
|
||||||
|
|
||||||
def _registerNewAccount(self, client, jid_, password, email, server):
|
def _registerNewAccount(self, client, jid_, password, email, server):
|
||||||
# FIXME: port is not set here
|
# FIXME: port is not set here
|
||||||
def registeredCb(dummy):
|
def registeredCb(__):
|
||||||
xmlui = xml_tools.XMLUI(u"popup", title=D_(u"Confirmation"))
|
xmlui = xml_tools.XMLUI(u"popup", title=D_(u"Confirmation"))
|
||||||
xmlui.addText(D_("Registration successful."))
|
xmlui.addText(D_("Registration successful."))
|
||||||
return {"xmlui": xmlui.toXml()}
|
return {"xmlui": xmlui.toXml()}
|
||||||
|
|
|
||||||
|
|
@ -488,7 +488,7 @@ class RoomGame(object):
|
||||||
user_jid = self.host.getJidNStream(profile)[0]
|
user_jid = self.host.getJidNStream(profile)[0]
|
||||||
d = self.host.plugins["XEP-0045"].join(room_jid, user_jid.user, {}, profile)
|
d = self.host.plugins["XEP-0045"].join(room_jid, user_jid.user, {}, profile)
|
||||||
return d.addCallback(
|
return d.addCallback(
|
||||||
lambda dummy: self._createOrInvite(client, room_jid, other_players)
|
lambda __: self._createOrInvite(client, room_jid, other_players)
|
||||||
)
|
)
|
||||||
|
|
||||||
def userJoinedTrigger(self, room, user, profile):
|
def userJoinedTrigger(self, room, user, profile):
|
||||||
|
|
@ -520,7 +520,7 @@ class RoomGame(object):
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
other_players = self.invitations[room_jid][batch][1]
|
other_players = self.invitations[room_jid][batch][1]
|
||||||
(auth, nicks, dummy) = self._checkWaitAuth(room, other_players)
|
(auth, nicks, __) = self._checkWaitAuth(room, other_players)
|
||||||
if auth:
|
if auth:
|
||||||
del self.invitations[room_jid][batch]
|
del self.invitations[room_jid][batch]
|
||||||
nicks.insert(0, profile_nick) # add the referee
|
nicks.insert(0, profile_nick) # add the referee
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ class UploadPlugin(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def uploadCb(data):
|
def uploadCb(data):
|
||||||
progress_id, dummy = data
|
progress_id, __ = data
|
||||||
return {"progress": progress_id}
|
return {"progress": progress_id}
|
||||||
|
|
||||||
def uploadEb(fail):
|
def uploadEb(fail):
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue