globalforest/treepopupmenu.py

18 lines
1 KiB
Python
Raw Normal View History

2020-10-14 16:38:48 -04:00
from kivymd.uix.dialog import ListMDDialog
2020-10-14 00:19:43 -04:00
class TreePopupMenu(ListMDDialog):
2020-10-14 00:19:43 -04:00
def __init__(self, tree_data):
super().__init__()
2020-10-14 00:19:43 -04:00
# Set all of the fields of tree data
2020-10-14 17:52:34 -04:00
headers = "Name,Lat,Lon,Description"
#headers = "FMID,MarketName,Website,Facebook,Twitter,Youtube,OtherMedia,street,city,County,State,zip,Season1Date,Season1Time,Season2Date,Season2Time,Season3Date,Season3Time,Season4Date,Season4Time,x,y,Location,Credit,WIC,WICcash,SFMNP,SNAP,Organic,Bakedgoods,Cheese,Crafts,Flowers,Eggs,Seafood,Herbs,Vegetables,Honey,Jams,Maple,Meat,Nursery,Nuts,Plants,Poultry,Prepared,Soap,Trees,Wine,Coffee,Beans,Fruits,Grains,Juices,Mushrooms,PetFood,Tofu,WildHarvested,updateTime"
2020-10-14 00:19:43 -04:00
headers = headers.split(',')
for i in range(len(headers)):
attribute_name = headers[i]
2020-10-14 17:52:34 -04:00
print("attr name " + attribute_name)
2020-10-14 00:19:43 -04:00
attribute_value = tree_data[i]
2020-10-14 17:52:34 -04:00
print("attr value " + attribute_value)
setattr(self, attribute_name, attribute_value)