Пример #1
0
def importBSMXMash(data):
    mash = Mash()
    mash.name = data.find('F_MH_NAME').text
    mash.grainTemp = "%.2f" % farenheit_to_celsius(float(data.find('F_MH_GRAIN_TEMP').text))
    mash.tunTemp = "%.2f" % farenheit_to_celsius(float(data.find('F_MH_TUN_TEMP').text))
    mash.spargeTemp = "%.2f" % farenheit_to_celsius(float(data.find('F_MH_SPARGE_TEMP').text))
    mash.ph = "%.1f" % float(data.find('F_MH_PH').text)
    mashSteps = data.find('steps').find('Data').findall('MashStep')
    for step in mashSteps:
        mash.listeSteps.append(importBSMXMashStep(step))
    return mash
Пример #2
0
def importBSMXMash(data):
    mash = Mash()
    mash.name = data.find('F_MH_NAME').text
    mash.grainTemp = "%.2f" % farenheit_to_celsius(
        float(data.find('F_MH_GRAIN_TEMP').text))
    mash.tunTemp = "%.2f" % farenheit_to_celsius(
        float(data.find('F_MH_TUN_TEMP').text))
    mash.spargeTemp = "%.2f" % farenheit_to_celsius(
        float(data.find('F_MH_SPARGE_TEMP').text))
    mash.ph = "%.1f" % float(data.find('F_MH_PH').text)
    mashSteps = data.find('steps').find('Data').findall('MashStep')
    for step in mashSteps:
        mash.listeSteps.append(importBSMXMashStep(step))
    return mash
Пример #3
0
 def addMash(self):
     new_mash = Mash()
     new_mash.name = 'Nouveau profil'
     new_mash.grainTemp = '0'
     new_mash.tunTemp = '0'
     new_mash.spargeTemp = '78'
     new_mash.ph = 5.4
     new_step = MashStep()
     new_step.name = 'Nouveau Palier'
     new_step.type = 'Infusion'
     new_step.time = '0'
     new_step.temp = '0'
     new_mash.listeSteps.append(new_step)
     ImportBase().listeMashes.append(new_mash)
     self.seeMash()
     self.listWidgetMashProfiles.setCurrentRow(
         len(ImportBase().listeMashes) - 1)
Пример #4
0
def importBeerXMLMash(data):
    mash = Mash()

    for child in data:
        if 'NAME' == child.tag:
            mash.name = child.text
        if 'GRAIN_TEMP' == child.tag:
            mash.grainTemp = child.text
        if 'TUN_TEMP' == child.tag:
            mash.tunTemp = child.text
        if 'SPARGE_TEMP' == child.tag:
            mash.spargeTemp = "%.1f" % float(child.text)
        if 'PH' == child.tag:
            mash.ph = "%.1f" % float(child.text)

    mashStep = data.findall('.//MASH_STEP')
    for element in mashStep:
        mash.listeSteps.append(importBeerXMLMashStep(element))

    return mash
Пример #5
0
def importBeerXMLMash(data):
    mash = Mash()

    for child in data:
        if 'NAME' == child.tag:
            mash.name = child.text
        if 'GRAIN_TEMP' == child.tag:
            mash.grainTemp = child.text
        if 'TUN_TEMP' == child.tag:
            mash.tunTemp = child.text
        if 'SPARGE_TEMP' == child.tag:
            mash.spargeTemp = "%.1f" % float(child.text)
        if 'PH' == child.tag :
            mash.ph = "%.1f" % float(child.text)

    mashStep = data.findall('.//MASH_STEP')
    for element in mashStep:
        mash.listeSteps.append(importBeerXMLMashStep(element))
    
    return mash