Skip to content

Commit 253471b

Browse files
Merge pull request #77 from AfricasVoices/format_argparse_arguments
format argparse arguments
2 parents 8cdbb5e + d176078 commit 253471b

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

mno_analysis_tools/compute_window_of_downtime.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,17 @@
1414
parser = argparse.ArgumentParser(
1515
description="Compute maximum window of time with 0 messages")
1616
parser.add_argument("raw_messages_file_path", metavar="input-file",
17-
help="File to read the raw data downloaded as json",
18-
)
17+
help="File to read the raw messages data downloaded as JSON")
1918
parser.add_argument("window_of_downtimes_output_file_path", metavar="output-file",
20-
help="File to write the raw data downloaded as json.",
21-
)
19+
help="File to write the raw messages data downloaded as jSON.")
2220
parser.add_argument("target_operator", metavar="operator",
23-
help="Operator to analyze for downtime",
24-
)
21+
help="Operator to analyze for downtime")
2522
parser.add_argument("target_message_direction", metavar="direction-of-message", choices=('in', 'out'),
26-
help="Direction of messages to limit the search for downtime to"
27-
)
23+
help="Direction of messages to limit the search for downtime to")
2824
parser.add_argument("start_date", metavar="start-date", type=lambda s: isoparse(s),
29-
help="The start date as ISO 8601 string from which the window of downtime will be computed",
30-
)
25+
help="The start date as ISO 8601 string from which the window of downtime will be computed")
3126
parser.add_argument("end_date", metavar="end-date", type=lambda s: isoparse(s),
32-
help="The end date as ISO 8601 string to which the window of downtime computation will end",
33-
)
27+
help="The end date as ISO 8601 string to which the window of downtime computation will end")
3428

3529
args = parser.parse_args()
3630

mno_analysis_tools/fetch_raw_messages.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,11 @@
1212
parser = argparse.ArgumentParser(
1313
description="Fetches archives from Rapid Pro instance")
1414
parser.add_argument("domain", metavar="domain",
15-
help="Domain that the instance of Rapid Pro is running on",
16-
)
15+
help="Domain that the instance of Rapid Pro is running on")
1716
parser.add_argument("token", metavar="token",
18-
help="Token for authenticating to the instance",
19-
)
17+
help="Token for authenticating to the instance")
2018
parser.add_argument("raw_messages_file_path", metavar="output-file-path",
21-
help="File to write the raw data downloaded as json",
22-
)
19+
help="File to write the raw data downloaded as json")
2320

2421
args = parser.parse_args()
2522
source_domain = args.domain

0 commit comments

Comments
 (0)