Fix 2to3 progression percentage (no long go over 100%).

This commit is contained in:
Valentin Lorentz 2015-02-07 08:14:18 +01:00
parent 9b36fc9427
commit 29de1e137d

View File

@ -36,6 +36,7 @@ import time
import datetime
import tempfile
import subprocess
from math import ceil
debug = '--debug' in sys.argv
@ -142,7 +143,7 @@ try:
if self._total_files//10 != 0 and \
self._refactored_files % (self._total_files//10) == 0:
print('Refactoring files: %i%% (%i on %i).' %
(self._refactored_files/(self._total_files//10)*10,
(ceil(self._refactored_files*100./self._total_files),
self._refactored_files, self._total_files))
self._refactored_files += 1
return super(DistutilsRefactoringTool, self).refactor_file(