mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-24 19:56:35 +00:00
size-stats-compare: fix code style
Fix these warnings: E129 visually indented line with same indent as next logical line E302 expected 2 blank lines, found 1 Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Yann E. MORIN <yann.morin.1998@free.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
f6809dba0f
commit
19aaf8c3f1
@ -24,14 +24,15 @@ import csv
|
|||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def read_file_size_csv(inputf, detail=None):
|
def read_file_size_csv(inputf, detail=None):
|
||||||
"""Extract package or file sizes from CSV file into size dictionary"""
|
"""Extract package or file sizes from CSV file into size dictionary"""
|
||||||
sizes = {}
|
sizes = {}
|
||||||
reader = csv.reader(inputf)
|
reader = csv.reader(inputf)
|
||||||
|
|
||||||
header = next(reader)
|
header = next(reader)
|
||||||
if (header[0] != 'File name' or header[1] != 'Package name' or
|
if header[0] != 'File name' or header[1] != 'Package name' or \
|
||||||
header[2] != 'File size' or header[3] != 'Package size'):
|
header[2] != 'File size' or header[3] != 'Package size':
|
||||||
print(("Input file %s does not contain the expected header. Are you "
|
print(("Input file %s does not contain the expected header. Are you "
|
||||||
"sure this file corresponds to the file-size-stats.csv "
|
"sure this file corresponds to the file-size-stats.csv "
|
||||||
"file created by 'make graph-size'?") % inputf.name)
|
"file created by 'make graph-size'?") % inputf.name)
|
||||||
@ -45,6 +46,7 @@ def read_file_size_csv(inputf, detail=None):
|
|||||||
|
|
||||||
return sizes
|
return sizes
|
||||||
|
|
||||||
|
|
||||||
def compare_sizes(old, new):
|
def compare_sizes(old, new):
|
||||||
"""Return delta/added/removed dictionaries based on two input size
|
"""Return delta/added/removed dictionaries based on two input size
|
||||||
dictionaries"""
|
dictionaries"""
|
||||||
@ -64,6 +66,7 @@ def compare_sizes(old, new):
|
|||||||
|
|
||||||
return delta
|
return delta
|
||||||
|
|
||||||
|
|
||||||
def print_results(result, threshold):
|
def print_results(result, threshold):
|
||||||
"""Print the given result dictionary sorted by size, ignoring any entries
|
"""Print the given result dictionary sorted by size, ignoring any entries
|
||||||
below or equal to threshold"""
|
below or equal to threshold"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user