From b0617b1933e3f1a0e6ac206267378ed1be4f4c87 Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Wed, 7 Jun 2023 07:11:26 -0400 Subject: [PATCH] wip nnest, want to color code & tree view `anl` --- ntclient/core/nnest.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ntclient/core/nnest.py b/ntclient/core/nnest.py index fba911c..66dfc4d 100644 --- a/ntclient/core/nnest.py +++ b/ntclient/core/nnest.py @@ -5,8 +5,27 @@ Created on Sat Aug 29 19:43:55 2020 @author: shane """ + +# pylint: disable=too-few-public-methods +class Nutrient: + """Tracks properties of nutrients; used in the tree structure of nutrient groups""" + + def __init__(self, nut_id: int, name: str, hidden: bool = False): + self.nut_id = nut_id + self.name = name + self.hidden = hidden + + nnest = { - "basics": ["Protein", "Carbs", "Fats", "Fiber", "Calories"], + # "basics": ["Protein", "Carbs", "Fats", "Fiber", "Calories"], + "basics": { + # 203: {"name": "Protein", "hidden": False}, + 203: Nutrient(203, "Protein"), + 205: "Carbs", + 204: "Fats", + 291: "Fiber", + 208: "Calories (kcal)", + }, "macro_details": {"Carbs": {}, "Fat": {}}, "micro_nutrients": { "Vitamins": {"Water-Soluble": {}, "Fat-Soluble": {}}, -- 2.52.0