Skip to content

Commit

Permalink
Features --> Dog Adoption Form (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerlight071 authored Feb 7, 2024
2 parents 581da1c + e6da260 commit 022789a
Show file tree
Hide file tree
Showing 5 changed files with 418 additions and 208 deletions.
23 changes: 18 additions & 5 deletions client_database.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import time
from colorama import Fore, Style
from common_functions import clear_screen
from customer_adoption_form import view_available_animals
from customer_adoption_form_dog import adopt_dog_form

def modify_clint_database():
clear_screen()
Expand All @@ -15,10 +15,23 @@ def modify_clint_database():
choice = input("\nPlease select an option: ")

if choice == '1':
print(Fore.GREEN + "\nOpening Customer Adoption Form..." + Style.RESET_ALL)
time.sleep(1)
clear_screen()
view_available_animals()
adoption_form = input("\nOpen adoption form for dogs or cats? ")
if adoption_form not in ['dogs', 'cats']:
print(Fore.RED + "\nInvalid input. Please try again." + Style.RESET_ALL)
time.sleep(2)
clear_screen()
modify_clint_database()

if adoption_form == 'dogs':
print("\n Opening dog adoption form...")
time.sleep(2)
clear_screen()
adopt_dog_form()

elif adoption_form == 'cats':
print("\nThis feature is coming soon.")
time.sleep(2)
clear_screen()

elif choice == '2':
print("\nThis feature is coming soon.")
Expand Down
11 changes: 11 additions & 0 deletions common_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import datetime
import configparser
import subprocess
import time
from colorama import Fore, Style

def clear_screen():
Expand Down Expand Up @@ -80,6 +81,16 @@ def get_mongodb_uri():
with open(config_file, 'w') as configfile:
config.write(configfile)
return uri

def get_input(prompt):
while True:
value = input(prompt)
if value: # if the string is not empty
return value
else:
print(Fore.RED + "\nThis field cannot be left blank. Please try again." + Style.RESET_ALL)
time.sleep(2)


#! One time use until proper implementation
# Function to print the table of animals
Expand Down
203 changes: 0 additions & 203 deletions customer_adoption_form.py

This file was deleted.

Loading

0 comments on commit 022789a

Please sign in to comment.