import argparse
import sys
+
def read_file_size_csv(inputf, detail=None):
"""Extract package or file sizes from CSV file into size dictionary"""
sizes = {}
reader = csv.reader(inputf)
header = next(reader)
- if (header[0] != 'File name' or header[1] != 'Package name' or
- header[2] != 'File size' or header[3] != 'Package size'):
+ if header[0] != 'File name' or header[1] != 'Package name' or \
+ header[2] != 'File size' or header[3] != 'Package size':
print(("Input file %s does not contain the expected header. Are you "
"sure this file corresponds to the file-size-stats.csv "
"file created by 'make graph-size'?") % inputf.name)
return sizes
+
def compare_sizes(old, new):
"""Return delta/added/removed dictionaries based on two input size
dictionaries"""
return delta
+
def print_results(result, threshold):
"""Print the given result dictionary sorted by size, ignoring any entries
below or equal to threshold"""