Improve readability.
This commit is contained in:
parent
e937782a4e
commit
b48a66a2e5
@ -46,12 +46,11 @@ class UnsquashOperation:
|
|||||||
def reportProgress( self ):
|
def reportProgress( self ):
|
||||||
progress = float( 0 )
|
progress = float( 0 )
|
||||||
for statusEntry in self.unpackstatus:
|
for statusEntry in self.unpackstatus:
|
||||||
partialProgress = float( 0 )
|
if statusEntry.total == 0:
|
||||||
if statusEntry.total is not 0:
|
|
||||||
partialProgress += 0.05
|
|
||||||
else:
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
partialProgress = 0.05 # Having a total !=0 gives 5%
|
||||||
|
|
||||||
partialProgress += 0.95 * ( statusEntry.copied / float( statusEntry.total ) )
|
partialProgress += 0.95 * ( statusEntry.copied / float( statusEntry.total ) )
|
||||||
progress += partialProgress / len( self.unpackstatus )
|
progress += partialProgress / len( self.unpackstatus )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user