558
558
current_sources, current_binaries)
562
"""Helper to compute percentage ratios compared to a fixed total."""
564
def __init__(self, total):
567
def get_ratio(self, number):
568
"""Report the ration of `number` to `self.total`, as a percentage."""
569
return (float(number) / self.total) * 100
561
572
def do_diff(Sources, Suite, origin, arguments, current_binaries):
563
574
stat_cant_update = 0
622
633
% (pkg, dest_version, source_version))
636
percentages = Percentages(stat_count)
626
638
print ("Out-of-date BUT modified: %3d (%.2f%%)"
627
% (stat_cant_update, (float(stat_cant_update)/stat_count)*100))
639
% (stat_cant_update, percentages.get_ratio(stat_cant_update)))
628
640
print ("Updated: %3d (%.2f%%)"
629
% (stat_updated, (float(stat_updated)/stat_count)*100))
641
% (stat_updated, percentages.get_ratio(stat_updated)))
630
642
print ("Ubuntu Specific: %3d (%.2f%%)"
631
% (stat_us, (float(stat_us)/stat_count)*100))
643
% (stat_us, percentages.get_ratio(stat_us)))
632
644
print ("Up-to-date [Modified]: %3d (%.2f%%)"
633
% (stat_uptodate_modified,
634
(float(stat_uptodate_modified)/stat_count)*100))
645
% (stat_uptodate_modified, percentages.get_ratio(
646
stat_uptodate_modified)))
635
647
print ("Up-to-date: %3d (%.2f%%)"
636
% (stat_uptodate, (float(stat_uptodate)/stat_count)*100))
648
% (stat_uptodate, percentages.get_ratio(stat_uptodate)))
637
649
print ("Blacklisted: %3d (%.2f%%)"
638
% (stat_blacklisted, (float(stat_blacklisted)/stat_count)*100))
650
% (stat_blacklisted, percentages.get_ratio(stat_blacklisted)))
639
651
print ("Broken: %3d (%.2f%%)"
640
% (stat_broken, (float(stat_broken)/stat_count)*100))
652
% (stat_broken, percentages.get_ratio(stat_broken)))
641
653
print " -----------"
642
654
print "Total: %s" % (stat_count)