Skip to content

Commit

Permalink
Simpler to read, possible performance enhancement. Refactored some of…
Browse files Browse the repository at this point in the history
… the lateral areas of the bash script. (#44)
  • Loading branch information
Montana committed Oct 24, 2023
1 parent 2b24268 commit 6a9afd8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions hyperledger/scripts/concatenator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
import json
import os

def concatenatePerConfiguration(inputdir: str, output:str):

def concatenatePerConfiguration(inputdir: str, output: str):
order = None

with open(os.path.join(inputdir, "concatenationConfig.json"), "r") as f:
order = json.load(f)

with open(output, "w") as outfile:
for file in order:
with open(os.path.join(inputdir, file), "r") as f:
outfile.writelines(f.readlines())
outfile.writelines([os.linesep])


if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Converts gathered Kubernetes metrics from tabular form to JSON.')
parser.add_argument('-i', '--inputdir',
help="The input directory.", required=True)
parser.add_argument('-o', '--output',
help="The output file.", required=True)
description="Converts gathered Kubernetes metrics from tabular form to JSON."
)
parser.add_argument("-i", "--inputdir", help="The input directory.", required=True)
parser.add_argument("-o", "--output", help="The output file.", required=True)

args = parser.parse_args()

Expand Down

0 comments on commit 6a9afd8

Please sign in to comment.