Skip to content

format argparse arguments #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions mno_analysis_tools/compute_window_of_downtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,17 @@
parser = argparse.ArgumentParser(
description="Compute maximum window of time with 0 messages")
parser.add_argument("raw_messages_file_path", metavar="input-file",
help="File to read the raw data downloaded as json",
)
help="File to read the raw messages data downloaded as JSON")
parser.add_argument("window_of_downtimes_output_file_path", metavar="output-file",
help="File to write the raw data downloaded as json.",
)
help="File to write the raw messages data downloaded as jSON.")
parser.add_argument("target_operator", metavar="operator",
help="Operator to analyze for downtime",
)
help="Operator to analyze for downtime")
parser.add_argument("target_message_direction", metavar="direction-of-message", choices=('in', 'out'),
help="Direction of messages to limit the search for downtime to"
)
help="Direction of messages to limit the search for downtime to")
parser.add_argument("start_date", metavar="start-date", type=lambda s: isoparse(s),
help="The start date as ISO 8601 string from which the window of downtime will be computed",
)
help="The start date as ISO 8601 string from which the window of downtime will be computed")
parser.add_argument("end_date", metavar="end-date", type=lambda s: isoparse(s),
help="The end date as ISO 8601 string to which the window of downtime computation will end",
)
help="The end date as ISO 8601 string to which the window of downtime computation will end")

args = parser.parse_args()

Expand Down
9 changes: 3 additions & 6 deletions mno_analysis_tools/fetch_raw_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
parser = argparse.ArgumentParser(
description="Fetches archives from Rapid Pro instance")
parser.add_argument("domain", metavar="domain",
help="Domain that the instance of Rapid Pro is running on",
)
help="Domain that the instance of Rapid Pro is running on")
parser.add_argument("token", metavar="token",
help="Token for authenticating to the instance",
)
help="Token for authenticating to the instance")
parser.add_argument("raw_messages_file_path", metavar="output-file-path",
help="File to write the raw data downloaded as json",
)
help="File to write the raw data downloaded as json")

args = parser.parse_args()
source_domain = args.domain
Expand Down