core, plugin file: fixed progress id + data is now returned by getProgress, instead of being an argument to fill

This commit is contained in:
Goffi 2015-11-14 19:20:33 +01:00
commit 2c8b91ee6c

View file

@ -811,7 +811,7 @@ class SAT(service.Service):
def _progressGet(self, progress_id, profile):
data = self.progressGet(progress_id, profile)
return {k: unicode(v) for k,v in data}
return {k: unicode(v) for k,v in data.iteritems()}
def progressGet(self, progress_id, profile):
"""Return a dict with progress information
@ -824,11 +824,10 @@ class SAT(service.Service):
if id doesn't exists (may be a finished progression), and empty dict is returned
"""
client = self.getClient(profile)
data = {}
try:
client._progress_cb[progress_id](progress_id, data, profile)
data = client._progress_cb[progress_id](progress_id, profile)
except KeyError:
log.debug("Requested progress for unknown progress_id")
data = {}
return data
def _progressGetAll(self, profile_key):
@ -844,9 +843,9 @@ class SAT(service.Service):
@param profile_key: %(doc_profile)s get all progress from this profile
if C.PROF_KEY_ALL is used, all progress from all profiles are returned
@return (dict[dict]): key=progress id, value=dict of data with the following keys:
'position' (int): current possition
'size' (int): end_position
@return (dict[dict[dict]]): a dict which map profile to progress_dict
progress_dict map progress_id to progress_data
progress_data is the same dict as returned by [progressGet]
"""
clients = self.getClients(profile_key)
progress_all = {}