Mercurial > libervia-backend
changeset 1602:33728a2f17bf
plugin file: 'size' key is not added anymore in progress'data if size is 0 or not specified in SatFile
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 15 Nov 2015 23:11:38 +0100 (2015-11-15) |
parents | e0a152f2cf6d |
children | 2b82d846848e |
files | src/plugins/plugin_misc_file.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/plugin_misc_file.py Sun Nov 15 23:11:27 2015 +0100 +++ b/src/plugins/plugin_misc_file.py Sun Nov 15 23:11:38 2015 +0100 @@ -97,7 +97,10 @@ return self._file.tell() def getProgress(self, progress_id, profile): - return {'position': self._file.tell(), 'size': self.size or -1} + ret = {'position': self._file.tell()} + if self.size: + ret['size'] = self.size + return ret class FilePlugin(object):