1 from Components.Sources.Source import Source
3 class VariableProgressSource(Source):
4 """Source to feed Progress Renderer from HTTPProgressDownloader"""
7 # Initialize and invalidate
16 self.changed((self.CHANGED_CLEAR, ))
18 def writeValues(self, pos, max):
19 # Increase Factor as long as range is too big
20 if self.range > 5000000:
24 # Only save range if not None
26 self.range = max / self.factor
29 self.value = pos / self.factor
32 self.changed((self.CHANGED_ALL, ))