-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathingredients.py
executable file
·24 lines (20 loc) · 1.04 KB
/
ingredients.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (c) 2009 Jeremy English <[email protected]>
# Permission to use, copy, modify, distribute, and sell this software
# and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appear in all copies and
# that both that copyright notice and this permission notice appear in
# supporting documentation. No representations are made about the
# suitability of this software for any purpose. It is provided "as
# is" without express or implied warranty.
# Created: 06-April-2009
from grains import *
class Ingredient:
"""Class used to define the ingredients (grains) for a recipe.
When creating the ingredient you can specify the amounts in
prectange or poinds."""
def __init__(self, grain, percent=0.0, lbs=0, brew_const=DEF_BREW_CONST):
if not isinstance(grain, Grain):
raise TypeError, "grain must be an instance of a Grain object."
self.grain = Grain(grain.ppg, grain.des, brew_const=brew_const)
self.percent = percent
self.lbs = lbs