Skip to content

Commit 1ab08f5

Browse files
committed
make httpgraph-loader take an optional filename
1 parent 69927ea commit 1ab08f5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

httpgraph-loader.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@
1414
import itertools
1515
from urllib import request
1616
from tqdm import tqdm
17+
from argparse import ArgumentParser
1718

1819
batch_size = 500
19-
file = "httpgraph-requests.json"
2020
url = "http://localhost:65444/add_record"
2121

22-
with open(file, "r", encoding="utf-8") as f:
22+
parser = ArgumentParser()
23+
parser.add_argument("filename", nargs="?", default="httpgraph-requests.json")
24+
args = parser.parse_args()
25+
26+
with open(args.filename, "r", encoding="utf-8") as f:
2327
pbar = tqdm(total=len(f.readlines()), unit=" URLs")
2428
f.seek(0)
2529

0 commit comments

Comments
 (0)