Mercurial > libervia-backend
comparison src/plugins/plugin_misc_file.py @ 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 |
parents | e0a152f2cf6d |
children | 4741e2f5eed2 |
comparison
equal
deleted
inserted
replaced
1601:e0a152f2cf6d | 1602:33728a2f17bf |
---|---|
95 | 95 |
96 def tell(self): | 96 def tell(self): |
97 return self._file.tell() | 97 return self._file.tell() |
98 | 98 |
99 def getProgress(self, progress_id, profile): | 99 def getProgress(self, progress_id, profile): |
100 return {'position': self._file.tell(), 'size': self.size or -1} | 100 ret = {'position': self._file.tell()} |
101 if self.size: | |
102 ret['size'] = self.size | |
103 return ret | |
101 | 104 |
102 | 105 |
103 class FilePlugin(object): | 106 class FilePlugin(object): |
104 File=SatFile | 107 File=SatFile |
105 | 108 |