def register_cage(): print(' ****************** REGISTER CAGE **************** ') if not state.active_account: error_msg('You must login first to register for a cage.') return meters = input('How many square meters is the cage? ') price = input('How much are you charging? ') if not meters: error_msg('Cancelled') return meters = float(meters) carpeted = input('Is it carpeted [y, n]? ').lower().startswith('y') has_toys = input('Have snake toys [y, n]? ').lower().startswith('y') allow_dangerous = input( 'Can you host a venomous snake [y, n]? ').lower().startswith('y') name = input('Give your cage a name: ') price = float(price) cage = svc.register_cage(state.active_account, name, allow_dangerous, has_toys, carpeted, meters, price) state.reload_account() success_msg(f'Register new cage with id {cage.id}.')
def register_cage(): print(' ****************** REGISTER CAGE **************** ') active_account = state.active_account if not active_account: error_msg(f'Please Login or create a new account : - ') return meters = input("How many square meters is the Cage ?") if not meters: error_msg(f'Enter the Cage Size in sq.mts ') return meters = float(meters) carpeted = input("Is it carpeted [y, n]? ").lower().startswith('y') has_toys = input("Have snake toys [y, n]? ").lower().startswith('y') allow_dangerous = input( "Can you host venomous snakes [y, n]? ").lower().startswith('y') name = input("Give your cage a name: ") price = float(input("How much is a noit ?")) cage = svc.register_cage(state.active_account, name, allow_dangerous, has_toys, carpeted, meters, price) state.reload_account() success_msg(f'Cage registered with ID {cage.id}')
def register_cage(): print(' ****************** REGISTER CAGE **************** ') if not state.active_account: error_msg("Must be logged in to register a cage") return metres = input('How many square metres is the cage? ') if not metres: error_msg('Cancelled - no input given') return metres = float(metres) carpeted = input('Is it carpeted (y/n)? ').lower().startswith('y') has_toys = input('Does it have toys (y/n)? ').lower().startswith('y') dangerous_snakes_allowed = input('Dangerous snakes allowed (y/n)? ').lower().startswith('y') name = input('Name of cage: ') price = float(input('Cage price: ')) cage = svc.register_cage( state.active_account, name, price, metres, carpeted, has_toys, dangerous_snakes_allowed ) state.reload_account() success_msg(f"New Cage {name} successfully registered with id '{cage.id}")
def register_cage(): print(' ****************** REGISTER CAGE **************** ') if not state.active_account: error_msg('You must login first') return try: meters = float(input('How many square meters is the cage?')) except: error_msg('Cancelled') carpeted = input("Is carpeted [y,n]?").lower().startswith('y') has_toys = input("Have snake toys [y,n]?").lower().startswith('y') allow_dangerous = input( "can you keep poisonous snakes [y,n]?").lower().startswith('y') name = input("name for your cage would be?") price = float(input("how much you charging?")) cage = svc.register_cage(state.active_account, name, price, allow_dangerous, has_toys, carpeted, meters) state.reload_account( ) #to reflect the recently added data, we have to find it again success_msg(f'Registered new cage with id {cage.id}')
def register_cage(): print(' ****************** REGISTER CAGE **************** ') meters = input("how many meters? ") if not meters: error_msg("Cancelled") return meters = float(meters) carpeted = input("is Carpeted? (y/n) ").lower().startswith('y') has_toys = input("Has Toys? (y/n) ").lower().startswith('y') allow_dangerous = input( "Allow dangerous snake? (y/n) ").lower().startswith('y') name = input("give your cage Name: ") price = input("give your cage Price: ") price = float(price) cage = svc.register_cage(state.active_account, name, allow_dangerous, has_toys, carpeted, meters, price) state.reload_account() success_msg(f"Cage saved {cage.id}!")
def register_cage(): print(' ****************** REGISTER CAGE **************** ') if not state.active_account: error_msg('You must login first to register a cage.') return name = input('Give your cage a name: ') if not name: error_msg('Cancelled') return price = float(input('How much will you charge for your cage? ')) meters = float(input('Cage volume in square meters? ')) carpeted = input('Is the cage carpeted [y, n]? ').lower().startswith('y') has_toys = input('Does the cage have toys [y, n]? ').lower().startswith( 'y') allow_dangerous = input( 'Do you allow dangerous snakes [y, n]? ').lower().startswith('y') cage = svc.register_cage(state.active_account, name, price, meters, carpeted, has_toys, allow_dangerous) state.reload_account() success_msg(f'Registered new cage with id {cage.id}.')
def register_cage(): print(' ****************** REGISTER CAGE **************** ') if not state.active_account: print(f"You have to be logged in") return meters = input("Enter lengtg of snake") if not meters: print("cancelled") return meters = float(meters) name = input("Enter name of cage") price = float(input("Enter price of cage")) is_carpeted = input("is_carpeted?").lower().startswith('y') has_toys = input("has_toys ?").lower().startswith('y') allow_dangerous_snakes = input( "allow dangerous snakes?").lower().startswith('y') cage = svc.register_cage(state.active_account, name, meters, is_carpeted, has_toys, allow_dangerous_snakes, price) state.reload_account() print(f"created new cage with {cage.id}")