From 2bdbf9ef19ec5920602ed9afbf411ca00334ee68 Mon Sep 17 00:00:00 2001 From: Michael Kennedy Date: Tue, 6 Jun 2017 11:51:50 -0700 Subject: [PATCH] starter code for this demo. --- .gitignore | 4 ++ .../service_central/service_app.py | 56 +++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 src/07_mongoengine/service_central/service_app.py diff --git a/.gitignore b/.gitignore index 48b0263..d545238 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,7 @@ src/07_mongoengine/service_central_starter/.idea/misc.xml src/07_mongoengine/service_central_starter/.idea/modules.xml src/07_mongoengine/service_central_starter/.idea/service_central_starter.iml src/07_mongoengine/service_central_starter/.idea/inspectionProfiles/profiles_settings.xml +src/07_mongoengine/service_central/.idea/misc.xml +src/07_mongoengine/service_central/.idea/modules.xml +src/07_mongoengine/service_central/.idea/service_central.iml +src/07_mongoengine/service_central/.idea/inspectionProfiles/profiles_settings.xml diff --git a/src/07_mongoengine/service_central/service_app.py b/src/07_mongoengine/service_central/service_app.py new file mode 100644 index 0000000..0bc6a62 --- /dev/null +++ b/src/07_mongoengine/service_central/service_app.py @@ -0,0 +1,56 @@ +def main(): + print_header() + user_loop() + + +def print_header(): + print('----------------------------------------------') + print('| |') + print('| SERVICE CENTRAL v.02 |') + print('| demo edition |') + print('| |') + print('----------------------------------------------') + print() + + +def user_loop(): + while True: + print("Available actions:") + print(" * [a]dd car") + print(" * [l]ist cars") + print(" * [f]ind car") + print(" * perform [s]ervice") + print(" * e[x]it") + print() + ch = input("> ").strip().lower() + if ch == 'a': + add_car() + elif ch == 'l': + list_cars() + elif ch == 'f': + find_car() + elif ch == 's': + service_car() + elif not ch or ch == 'x': + print("Goodbye") + break + + +def add_car(): + print("TODO: add_car") + + +def list_cars(): + print("TODO: list_cars") + + +def find_car(): + print("TODO: find_car") + + +def service_car(): + print("TODO: service_car") + + +if __name__ == '__main__': + main()