Beispiel #1
0
 def prompt_init():
     parent_init = Property.prompt_init()
     laundry = get_valid_input(
         "What laundry facilities does "
         "the property have? ", Apartment.valid_laundries)
     balcony = get_valid_input("Does the property have a balcony? ",
                               Apartment.valid_balconies)
     parent_init.update({"laundry": laundry, "balcony": balcony})
     return parent_init
Beispiel #2
0
    def prompt_init():
        parent_init = Property.prompt_init()
        laundry = get_valid_custom_input(PROMPT_MESSAGE["laundry_input"],
                                         Apartment.valid_laundries) or ''
        balcony = get_valid_custom_input(PROMPT_MESSAGE["balcony_input"],
                                         Apartment.valid_balconies) or ''

        parent_init.update({"laundry": laundry, "balcony": balcony})
        #print(parent_init, '-->')

        return parent_init
 def prompt_init(self):
     parent_init = Property.prompt_init()
     laundry = ''
     while laundry.lower() not in Apartment.valid_laundries:
         laundry = input("What laundry facilities does the property have ? ({})".format(','.join(Apartment.valid_laundaries)))
     
     while balcony.lower() not in Apartment.valid_balconies:
         balcony = input("Does the property have a balcony ? ({})".format(','.join(Apartment.valid_balconies)))
     parent_init.update({"laundry": laundry, "balcony": balcony})
     
     return parent_init
Beispiel #4
0
    def prompt_init():
        parent_init = Property.prompt_init()
        fenced = get_valid_input("Is the yard fenced? ", House.valid_fenced)
        garage = get_valid_input("Is there a garage? ", House.valid_garage)
        num_stories = input("How many stories? ")

        parent_init.update({
            "fenced": fenced,
            "garage": garage,
            "num_stories": num_stories
        })
        return parent_init
Beispiel #5
0
    def prompt_init():
        parent_init = Property.prompt_init()
        num_stories = get_valid_type_input(PROMPT_MESSAGE["num_stories"],
                                           "number") or ''
        garage = get_valid_custom_input(PROMPT_MESSAGE["garage"],
                                        House.valid_garage) or ''
        fenced = get_valid_custom_input(PROMPT_MESSAGE["fenced"],
                                        House.valid_fenced) or ''

        parent_init.update({
            "num_stories": num_stories,
            "garage": garage,
            "fenced": fenced
        })
        #print(parent_init)
        return parent_init
Beispiel #6
0
 def prompt_init():
     """
     This method asks user to enter appropriate info for Apartment instance:
     first it calls parent method and then asks for additional info, which
     characterizes an Apartment instance - laundry and balcony.
     :return: (dict{(str):(str) })
     """
     parent_init = Property.prompt_init()
     laundry = get_valid_input("What laundry facilities does "
                               "the property have? ",
                               Apartment.valid_laundries)
     balcony = get_valid_input("Does the property have a balcony? ",
                               Apartment.valid_balconies)
     parent_init.update({
         "laundry": laundry,
         "balcony": balcony
     })
     return parent_init
Beispiel #7
0
 def prompt_init():
     """
     This method asks user to enter appropriate info for House instance:
     first it calls parent method and then asks for additional info,
     which characterizes a House instance - fence, garage and number of
     stories.
     :return: (dict{(str): (str)})
     """
     parent_init = Property.prompt_init()
     fenced = get_valid_input("Is the yard fenced? ", House.valid_fenced)
     garage = get_valid_input("Is there a garage? ", House.valid_garage)
     num_stories = input("How many stories? ")
     parent_init.update({
         "fenced": fenced,
         "garage": garage,
         "num_stories": num_stories
     })
     return parent_init
Beispiel #8
0
    def prompt_init(self):
        parent_init = Property.prompt_init()

        fenced = ''
        while fenced.lower() not in valid_fenced_yard:
            input('Does the house have a fenced yard ? ({})'.format(','.join(
                House.valid_fenced_yard)))

        garage = ''
        while garage.lower() not in valid_garage:
            input('What does the garage have ? ({})'.format(','.join(
                House.valid_garage)))

        num_stories = input('How many stories ?')

        parent_init.upate({
            'fenced': fenced,
            'garage': garage,
            'num_stories': num_stories
        })
Beispiel #9
0
    def prompt_init():
        parent_init = Property.prompt_init(
        )  #Call this static method from SuperClass

        #laundry = ''

        #while laundry.lower() not in Apartment.valid_laundries:
        #    laundry = input("What laundry facilities does the property have? ({})".format(
        #       ", ".join(Apartment.valid_laundries)))

        #   balcony = ''
        #   while balcony.lower() not in Apartment.valid_balconies:
        #       balcony =input("Does the property have a balcony? ({})".format(
        #         ", ".join(Apartment.valid_balconies)))
        laundry = Validinput.get_valid_input(
            "What laundry facilites does the property have? ",
            Apartment.valid_laundries)

        balcony = Validinput.get_valid_input(
            "Does the property have balcony? ", Apartment.valid_balconies)

        parent_init.update({"laundry": laundry, "balcony": balcony})

        return parent_init
Beispiel #10
0
 def prompt_init():
     parent_init = Property.prompt_init()
     balcony = input("Does the property have a balcony? [yes] [no]")
     elevator = input("Does the property has an elevator? [yes] [no]")
     parent_init.update({"elevator": elevator, "balcony": balcony})
     return parent_init
# What are the estimated taxes? 35000
# PROPERTY DETAILS
# ================
# square footage: 20000
# bedrooms:
# bathrooms: 3
#
# APARTMENT DETAILS
# laundry: none
# has balcony: solarium
# PURCHASE DETAILS
# selling price: 3225256
# estimated taxes: 35000
# What type of property?  (house, apartment)

print(Property.prompt_init())

# Enter the square feet: 500
# Enter number of bedrooms: 1
# Enter number of baths: 1

# {'square_feet': '500', 'beds': '1', 'baths': '1'}

print(House.prompt_init())

# Enter the square feet: 500
# Enter number of bedrooms: 2
# Enter number of baths: 3
# Is the yard fenced?  (yes, no) no
# Is there a garage?  (attached, detached, none) detached
# How many stories? 5