2 from __future__
import print_function
4 female_names = [
"emma",
"olivia",
"sophia",
"ava",
"isabella",
"mia",
"abigail",
"emily",
"charlotte",
"harper"]
5 male_names = [
"noah",
"liam",
"mason",
"jacob",
"william",
"ethan",
"james",
"alexander",
"michael",
"benjamin"]
6 names = female_names + male_names
11 {
"name":
"amigo_case",
"room":
"ToDo",
"category":
"ToDo",
"manipulation":
"no"},
12 {
"name":
"laptop_case",
"room":
"ToDo",
"category":
"ToDo",
"manipulation":
"no"},
13 {
"name":
"amigo_case_lid",
"room":
"ToDo",
"category":
"ToDo",
"manipulation":
"yes"},
14 {
"name":
"laptop_case_lid",
"room":
"ToDo",
"category":
"ToDo",
"manipulation":
"yes"},
17 location_rooms = list(set([o[
"room"]
for o
in locations]))
18 location_categories = list(set([o[
"category"]
for o
in locations]))
19 location_names = list(set([o[
"name"]
for o
in locations]))
20 manipulation_locations = list(set([o[
"name"]
for o
in locations
if o[
"manipulation"] ==
"yes"]))
23 {
"name":
"coke",
"category":
"drink"},
24 {
"name":
"fanta",
"category":
"drink"}
27 object_names = list(set([o[
"name"]
for o
in objects]))
28 object_categories = list(set([o[
"category"]
for o
in objects]))
30 category_locations = {
31 "drink": {
"amigo_case_lid":
"on_top_of"}
42 ''' colors from printing on screen '''
54 General function for printing shortcuts
55 name: name of the progam that instanciates make_prints
56 sentence: sentence to be displayed
58 Ex: "[<EXECUTIVE NAME>] <SENTENCE TO BE DISPLAYED>"
63 prefix = bcolors.HEADER + name + bcolors.ENDC
66 print(prefix + bcolors.OKBLUE + sentence + bcolors.ENDC)
69 print(prefix + bcolors.FAIL + sentence + bcolors.ENDC)
72 print(prefix + bcolors.WARNING + sentence + bcolors.ENDC)
74 return printOk, printError, printWarning
82 if loc[
"name"] == location:
88 if location
in location_rooms:
91 if loc[
"name"] == location:
97 if location
in inspect_areas:
98 return inspect_areas[location]
104 if location
in inspect_positions
and area
in inspect_positions[location]:
105 return inspect_positions[location][area]
111 for loc
in locations:
112 if loc[
"name"] == location
and loc[
"manipulation"] ==
"yes":
118 for loc
in locations:
119 if loc[
"name"] == location
and (loc[
"manipulation"] ==
"yes" or loc[
"manipulation"] ==
"only_putting"):
125 return [loc[
"name"]
for loc
in locations
126 if (room ==
None or loc[
"room"] == room)
and \
127 (pick_location ==
None or pick_location ==
is_pick_location(loc[
"name"]))
and \
132 return [obj[
"name"]
for obj
in objects
133 if category ==
None or category == obj[
"category"]]
145 location, area_name = next(iter(category_locations[obj_cat].items()))
146 return location, area_name
152 if __name__ ==
"__main__":
153 print(
"\n-----------------------------------------------------------------------------")
157 print(
"object '{}'".format(obj))
158 print(
" category: '{}'".format(cat))
159 print(
" found '{} {}'".format(area_name, location))
161 print(
"\n-----------------------------------------------------------------------------")
163 print(
"location '{}', room: '{}'".format(loc,
get_room(loc)))
165 print(
"\n-----------------------------------------------------------------------------")
166 print(
"Pick locations:")
168 print(
" {}".format(loc))
170 print(
"\n-----------------------------------------------------------------------------")
171 print(
"Place locations:")
173 print(
" {}".format(loc))
175 print(
"\n-----------------------------------------------------------------------------")
176 print(
"None-manipulation locations:")
178 print(
" {}".format(loc))