-
Notifications
You must be signed in to change notification settings - Fork 0
/
userpref.py
52 lines (41 loc) · 1.41 KB
/
userpref.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# when user entered and exited a place.
# report duration after entry and exit
import main
from typing import List, Dict
class User:
"""
data: {category(food): [specific(middle eastern), Time]}
"""
food: list
arts: list
entertainment: list
shopping: list
in_home_country: bool
def __init__(self, food, arts, entertainment, shopping, in_home_country):
self.food = food
self.arts = arts
self.entertainment = entertainment
self.shopping = shopping
self.in_home_country = in_home_country
def listExtender(self, oldlist):
newList = []
for x in oldlist:
newList.insert(0,[x,0])
return newList
def otherCountryPref(self, food, arts, entertainment, shopping):
if food != "":
foodList = self.listExtender(food.split(","))
self.food.insert(0,foodList)
if arts != "":
artsList = self.listExtender(arts.split(","))
self.arts.insert(0,artsList)
if entertainment != "":
entertainmentList = self.listExtender(entertainment.split(","))
self.entertainment.insert(0,entertainmentList)
if shopping != "":
shopList = self.listExtender(shopping.split(","))
self.shopping.insert(0,shopList)
print(self.food)
print(self.arts)
print(self.entertainment)
print(self.shopping)