mini_project_1.shell module

command shell for mini-project-1

class mini_project_1.shell.MiniProjectShell(database, register_start=False)[source]

Bases: cmd.Cmd

Main shell for mini-project-1

cmdloop(intro=None)[source]

Repeatedly issue a prompt, accept input, parse an initial prefix off the received input, and dispatch to action methods, passing them the remainder of the line as argument.

do_book_member()[source]
do_cancel_booking()[source]
do_delete_request()[source]
do_exit(arg)[source]

Logout (if needed) and exit out of the mini-project-1 shell

do_list_bookings()[source]
do_list_requests()[source]
do_login(arg)[source]

Login to the mini-project-1 database

do_logout()[source]
do_offer_ride()[source]
do_post_request()[source]
do_register(arg)[source]

Register a new member to the mini-project-1 database

do_search_requests_city()[source]
do_search_requests_lcode()[source]
do_search_rides()[source]
do_select_request()[source]
do_show_inbox()[source]
static help_book_member()[source]

Print the argparser help message for book_member

static help_cancel_booking()[source]

Print the argparser help message for cancel_booking

static help_delete_request()[source]

Print the argparser help message for deleting a ride request

static help_list_bookings()[source]

Print the argparser help message for list_bookings

static help_list_requests()[source]

Print the argparser help message for list_requests

static help_logout()[source]

Print the argparser help message for logout

static help_offer_ride()[source]

Print the argparser help message for offer_ride

static help_post_request()[source]

Print the argparser help message for post_request

static help_search_requests_city()[source]

Print the argparser help message for searching ride requests by city name

static help_search_requests_lcode()[source]

Print the argparser help message for searching ride requests by location code

static help_search_rides()[source]

Print the argparser help message for search_rides

static help_select_request()[source]

Print the argparser help message for selecting a ride request

static help_show_inbox()[source]

Print the argparser help message for show_inbox

intro = 'Welcome to mini-project-1 shell. Type help or ? to list commands\n'
login(email, password)[source]

Login method

Check if a LoginSession already exists for the shell if not attempt to login with the given email and password.

If the login attempt is successful set the shell’s login_session to the newly created loginsession.LoginSession.

login_session = None
logout()[source]
prompt = 'mini-project-1>'
mini_project_1.shell.logged_in(f)[source]

Annotation to check if someone is logged in before attempting a command in the MainProjectShell