From bb6f6f2b365486890b4e6fd3ff23564960d5a426 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 11:34:17 -0700 Subject: [PATCH 01/12] Add mashin step including the infusion temp from a beerxml import --- modules/recipe_import/beerxml.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index e9f17e0..fdc0e52 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -51,6 +51,8 @@ class BeerXMLImport(FlaskView): name = self.getRecipeName(id) self.api.set_config_parameter("brew_name", name) boil_time = self.getBoilTime(id) + mashin_temp = self.getMashinTemp(id) + mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep") mashstep_type = cbpi.get_config_parameter("step_mash", "MashStep") mash_kettle = cbpi.get_config_parameter("step_mash_kettle", None) @@ -64,6 +66,8 @@ class BeerXMLImport(FlaskView): try: + ## Add Mashin step + Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) @@ -87,6 +91,10 @@ class BeerXMLImport(FlaskView): e = xml.etree.ElementTree.parse(self.BEER_XML_FILE).getroot() return float(e.find('./RECIPE[%s]/BOIL_TIME' % (str(id))).text) + def getMashinTemp(self, id): + e = xml.etree.ElementTree.parse(self.BEER_XML_FILE).getroot() + return float('./RECIPE[%s]/MASH/MASH_STEPS/INFUSE_TEMP' % (str(id))).text) + def getSteps(self, id): From 6fd39a81a9d732334edf17d1a63bd6851fb840d4 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 21:50:28 -0700 Subject: [PATCH 02/12] Update beerxml.py --- modules/recipe_import/beerxml.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index fdc0e52..2fd2bd7 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -51,8 +51,8 @@ class BeerXMLImport(FlaskView): name = self.getRecipeName(id) self.api.set_config_parameter("brew_name", name) boil_time = self.getBoilTime(id) - mashin_temp = self.getMashinTemp(id) - mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep") + mashin_temp = self.getMashinTemp(id) + mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep") mashstep_type = cbpi.get_config_parameter("step_mash", "MashStep") mash_kettle = cbpi.get_config_parameter("step_mash_kettle", None) @@ -66,8 +66,8 @@ class BeerXMLImport(FlaskView): try: - ## Add Mashin step - Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) + ## Add Mashin step + Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) @@ -92,8 +92,8 @@ class BeerXMLImport(FlaskView): return float(e.find('./RECIPE[%s]/BOIL_TIME' % (str(id))).text) def getMashinTemp(self, id): - e = xml.etree.ElementTree.parse(self.BEER_XML_FILE).getroot() - return float('./RECIPE[%s]/MASH/MASH_STEPS/INFUSE_TEMP' % (str(id))).text) + e = xml.etree.ElementTree.parse(self.BEER_XML_FILE).getroot() + return float('./RECIPE[%s]/MASH/MASH_STEPS/INFUSE_TEMP' % (str(id))).text) def getSteps(self, id): From b4ddc60c075c4966825c6db086fc1105cca84773 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 21:52:34 -0700 Subject: [PATCH 03/12] Update beerxml.py --- modules/recipe_import/beerxml.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 2fd2bd7..d0ea733 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -51,8 +51,8 @@ class BeerXMLImport(FlaskView): name = self.getRecipeName(id) self.api.set_config_parameter("brew_name", name) boil_time = self.getBoilTime(id) - mashin_temp = self.getMashinTemp(id) - mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep") + mashin_temp = self.getMashinTemp(id) + mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep") mashstep_type = cbpi.get_config_parameter("step_mash", "MashStep") mash_kettle = cbpi.get_config_parameter("step_mash_kettle", None) @@ -66,8 +66,8 @@ class BeerXMLImport(FlaskView): try: - ## Add Mashin step - Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) + ## Add Mashin step + Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) From f60658c84e6728e07ccb4f3b46c08c7d7497073b Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 21:54:46 -0700 Subject: [PATCH 04/12] Update beerxml.py --- modules/recipe_import/beerxml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index d0ea733..a5db6eb 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -66,8 +66,8 @@ class BeerXMLImport(FlaskView): try: - ## Add Mashin step - Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) + ## Add Mashin step + Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) From 85f0c6cbffeaec339a2bb6e9ad9a705abbd58edb Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 22:04:10 -0700 Subject: [PATCH 05/12] test --- modules/recipe_import/beerxml.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index d0ea733..702b827 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -51,8 +51,7 @@ class BeerXMLImport(FlaskView): name = self.getRecipeName(id) self.api.set_config_parameter("brew_name", name) boil_time = self.getBoilTime(id) - mashin_temp = self.getMashinTemp(id) - mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep") + mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep") mashstep_type = cbpi.get_config_parameter("step_mash", "MashStep") mash_kettle = cbpi.get_config_parameter("step_mash_kettle", None) @@ -66,8 +65,8 @@ class BeerXMLImport(FlaskView): try: - ## Add Mashin step - Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) + ## Add Mashin step + Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) From 5d6e32a57f41a7564ad5dbb6002bf33dd6179c10 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 22:04:22 -0700 Subject: [PATCH 06/12] test --- modules/recipe_import/beerxml.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 702b827..6f6abb4 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -51,6 +51,7 @@ class BeerXMLImport(FlaskView): name = self.getRecipeName(id) self.api.set_config_parameter("brew_name", name) boil_time = self.getBoilTime(id) + mashin_temp = self.getMashinTemp(id) mashinstep_type = cbpi.get_config_parameter("step_mashin", "MashInStep") mashstep_type = cbpi.get_config_parameter("step_mash", "MashStep") mash_kettle = cbpi.get_config_parameter("step_mash_kettle", None) From ad02e2490d386fca7369ad7ae4dd3f1125221de5 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 22:08:52 -0700 Subject: [PATCH 07/12] Remove spaces --- modules/recipe_import/beerxml.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 67645e5..8a1f0c3 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -66,13 +66,9 @@ class BeerXMLImport(FlaskView): try: -<<<<<<< HEAD - ## Add Mashin step - Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) -======= + ## Add Mashin step Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) ->>>>>>> f60658c84e6728e07ccb4f3b46c08c7d7497073b for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) From b9b3fee8c98c5057ac8ff65ce444631a7dc1bfa6 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 22:08:52 -0700 Subject: [PATCH 08/12] Remove spaces --- modules/recipe_import/beerxml.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 67645e5..8a1f0c3 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -66,13 +66,9 @@ class BeerXMLImport(FlaskView): try: -<<<<<<< HEAD - ## Add Mashin step - Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) -======= + ## Add Mashin step Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) ->>>>>>> f60658c84e6728e07ccb4f3b46c08c7d7497073b for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) From ed9bbed0843f6ab70e8a4a605b712c40a82e36d2 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 22:26:08 -0700 Subject: [PATCH 09/12] Testing --- modules/recipe_import/beerxml.py | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 8a1f0c3..6ba298c 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -69,6 +69,7 @@ class BeerXMLImport(FlaskView): ## Add Mashin step Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) + for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) From e750fbb70e3d08f9623c3b66bbe1f64883de6886 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 22:38:42 -0700 Subject: [PATCH 10/12] Update beerxml.py --- modules/recipe_import/beerxml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 6ba298c..442812f 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -67,8 +67,8 @@ class BeerXMLImport(FlaskView): try: - ## Add Mashin step - Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) + ## Add Mashin step + Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) From 58fd9a659ef2d27b5f6811bb226f52bfde7b1ae3 Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 22:43:10 -0700 Subject: [PATCH 11/12] Update beerxml.py --- modules/recipe_import/beerxml.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 442812f..25f1b0e 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -65,11 +65,8 @@ class BeerXMLImport(FlaskView): StepView().reset() try: - - - ## Add Mashin step - Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) - + ## Add Mashin step + Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}}) From a368213cd11f109df97d14dd53b664b276771cbd Mon Sep 17 00:00:00 2001 From: swimIan Date: Sat, 15 Jul 2017 22:43:10 -0700 Subject: [PATCH 12/12] Update beerxml.py --- modules/recipe_import/beerxml.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/recipe_import/beerxml.py b/modules/recipe_import/beerxml.py index 442812f..25f1b0e 100644 --- a/modules/recipe_import/beerxml.py +++ b/modules/recipe_import/beerxml.py @@ -65,11 +65,8 @@ class BeerXMLImport(FlaskView): StepView().reset() try: - - - ## Add Mashin step - Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) - + ## Add Mashin step + Step.insert(**{"name": "MashIn", "type": mashinstep_type, "config": {"kettle": mash_kettle, "temp": mashin_temp}}) for row in steps: Step.insert(**{"name": row.get("name"), "type": mashstep_type, "config": {"kettle": mash_kettle, "temp": float(row.get("temp")), "timer": row.get("timer")}}) Step.insert(**{"name": "ChilStep", "type": "ChilStep", "config": {"timer": 15}})