Пример #1
0
 def getOutput(self):
         v = RecipeView()
         convertedRecipeText = ""
         #checks if user entered information in all fields
         #and that the input is valid
         #Convert the recipe if they are
         if self.errorFlag == False:
                 convertedRecipeText = self.processRecipe()
         elif self.submitted == True:
                 v.setErrorText(self.x)
                 errorFlag = False
                 #return error message and pull up
                 #reset errorFlag before recussion   
               
         #display final recipe for user
         v.setSystem(self.system)
         v.setOriginalRecipeText(self.originalRecipeText)
         v.setConvertedRecipeText(convertedRecipeText)
         v.setScaling(self.strScale)
         return v.getOutput()
Пример #2
0
from view import RecipeView

v = RecipeView()
v.setSystem("imperial")
v.setRecipeText("sample recipe text")
v.setScaling("1")
print (v.getOutput())