autograder.cli.users.password.reset

Request a password reset.

usage: python3 -m autograder.cli.users.password.reset [-h] [--version]
                                                      [--server SERVER]
                                                      [--user USER]
                                                      [--testing-mode]

Request a password reset.

options:
    -h, --help       show this help message and exit
    --version        show program's version number and exit

command-specific options:
    --server SERVER  The URL of the autograder server to communicate with.
    --user USER      The email of the user making this request.

testing options:
    --testing-mode   Run as if a test is being run (default: False).
 1"""
 2Request a password reset.
 3"""
 4
 5import argparse
 6import sys
 7
 8import autograder.api.users.password.reset
 9import autograder.cli.parser
10
11def run_cli(args: argparse.Namespace) -> int:
12    """ Run the CLI. """
13
14    config = args._config_info.application_config
15
16    autograder.api.users.password.reset.send(config, exit_on_error = True)
17    print("The server has successfully processed your request.")
18    print("Check your email for the new password.")
19
20    return 0
21
22def main() -> int:
23    """ Get a parser, parse the args, and call run. """
24
25    return run_cli(_get_parser().parse_args())
26
27def _get_parser() -> argparse.ArgumentParser:
28    """ Get a parser for this operation. """
29
30    parser = autograder.cli.parser.get_parser(
31        __doc__.strip(),
32        autograder.api.users.password.reset.API_PARAMS)
33
34    return parser
35
36if (__name__ == '__main__'):
37    sys.exit(main())
def run_cli(args: argparse.Namespace) -> int:
12def run_cli(args: argparse.Namespace) -> int:
13    """ Run the CLI. """
14
15    config = args._config_info.application_config
16
17    autograder.api.users.password.reset.send(config, exit_on_error = True)
18    print("The server has successfully processed your request.")
19    print("Check your email for the new password.")
20
21    return 0

Run the CLI.

def main() -> int:
23def main() -> int:
24    """ Get a parser, parse the args, and call run. """
25
26    return run_cli(_get_parser().parse_args())

Get a parser, parse the args, and call run.