diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-27 14:44:09 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-27 14:44:09 +0200 |
| commit | a339e7ba1018fd6ba895cf2d43256cd2bf01e9e9 (patch) | |
| tree | 296db7c1107a9e9ddf09bdfc424c5b7814221236 | |
| parent | 5d106be3ed2cfae5da5a5d87e7826b7c45870f09 (diff) | |
| download | allocbench-a339e7ba1018fd6ba895cf2d43256cd2bf01e9e9.tar.gz allocbench-a339e7ba1018fd6ba895cf2d43256cd2bf01e9e9.zip | |
add license info to merge.py
| -rwxr-xr-x | merge.py | 28 | ||||
| -rw-r--r-- | src/util.py | 6 |
2 files changed, 33 insertions, 1 deletions
@@ -1,14 +1,40 @@ #!/usr/bin/env python3 +# Copyright 2018-2019 Florian Fischer <florian.fl.fischer@fau.de> +# +# This file is part of allocbench. +# +# allocbench is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# allocbench is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with allocbench. If not, see <http://www.gnu.org/licenses/>. + +"""Merge two compatible results of an allocbench run""" + import argparse import os import pickle +import sys + +from src.util import print_license_and_exit def main(): + if "--license" in sys.argv: + print_license_and_exit() + parser = argparse.ArgumentParser(description="Merge to allocbench results") parser.add_argument("src", help="results which should be merged into dest", type=str) 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("-b", "--benchmarks", help="benchmarks to summarize", nargs='+') parser.add_argument("-x", "--exclude-benchmarks", help="benchmarks to exclude", nargs='+') @@ -28,7 +54,7 @@ def main(): dest_save = os.path.join(args.dest, os.path.basename(src_save)) if not os.path.isfile(dest_save): - print("Can't merge", src_save, "because", os.path.basename(src_save), "not in", args.dest) + print(f"Can't merge {src_save} because {os.path.basename(src_save)} not in {args.dest}") continue with open(src_save, "rb") as src_file: diff --git a/src/util.py b/src/util.py index 3b4de59..f9033f1 100644 --- a/src/util.py +++ b/src/util.py @@ -98,3 +98,9 @@ def print_warn(*objects, sep=' ', end='\n', file=sys.stdout): def print_error(*objects, sep=' ', end='\n', file=sys.stderr): allocbench_msg("RED", *objects, sep=sep, end=end, file=file) + + +def print_license_and_exit(): + print("Copyright (C) 2018-2019 Florian Fischer") + print("License GPLv3: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>") + exit(0) |
