Mercurial > libervia-backend
diff src/core/sat_main.py @ 1598:b144babc2658
core, plugin file: fixed progress id + data is now returned by getProgress, instead of being an argument to fill
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 14 Nov 2015 19:20:33 +0100 |
parents | a3d0cfa5b7a6 |
children | e2ed8009e66e |
line wrap: on
line diff
--- a/src/core/sat_main.py Sat Nov 14 19:19:04 2015 +0100 +++ b/src/core/sat_main.py Sat Nov 14 19:20:33 2015 +0100 @@ -811,7 +811,7 @@ 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 @@ 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 @@ @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 = {}