From 8174a918ea3b7cb216bf7ea98cfdc10661b5c37d Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 6 May 2020 16:56:32 +0200 Subject: make the whole project more python idiomatic * rename src directory to allocbench * make global variable names UPPERCASE * format a lot of code using yapf * use lowercase ld_preload and ld_library_path as Allocator members * name expected Errors 'err' and don't raise a new Exception * disable some pylint messages --- merge.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'merge.py') diff --git a/merge.py b/merge.py index 89bc7a4..7d95d90 100755 --- a/merge.py +++ b/merge.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2018-2019 Florian Fischer +# Copyright 2018-2020 Florian Fischer # # This file is part of allocbench. # @@ -25,16 +25,16 @@ import os import pickle import sys -import src.facter -from src.util import print_license_and_exit +import allocbench.facter as facter +from allocbench.util import print_license_and_exit def load_file(filename): if filename.endswith("json"): - with open(filename, "r") as f: - return json.load(f) + with open(filename, "r") as json_file: + return json.load(json_file) else: - with open(filename, "rb") as f: - return pickle.load(f) + with open(filename, "rb") as pickle_file: + return pickle.load(pickle_file) def main(): @@ -46,7 +46,7 @@ def main(): parser.add_argument("dest", help="results in which src should be merged", type=str) parser.add_argument("--license", help="print license info and exit", action='store_true') parser.add_argument("--version", help="print version info and exit", action='version', - version=f"allocbench {src.facter.allocbench_version()}") + version=f"allocbench {facter.allocbench_version()}") parser.add_argument("-b", "--benchmarks", help="benchmarks to summarize", nargs='+') parser.add_argument("-x", "--exclude-benchmarks", help="benchmarks to exclude", nargs='+') -- cgit v1.2.3