Esempio n. 1
0
def create_seeding(farm: Farm, planting, seeding, crop: Crop):
    area = [x for x in farm.areas if x.name == seeding['location']][0]
    seed_log = farm.create_seeding(
        planting, area, crop,
        datetime.combine(seeding['date'], datetime.min.time()),
        seeding['seeds'], seeding['source'])
    message("Created Seeding: {}".format(seed_log.name))
    return seed_log
Esempio n. 2
0
def create_transplant(farm, planting, transplant):
    area = [x for x in farm.areas if x.name == transplant['location']][0]
    trans_log = farm.create_transplant(planting,
                                       area,
                                       datetime.combine(
                                           transplant['date'],
                                           datetime.min.time()),
                                       done=transplant['done'])
    message("Created Transplanting: {}".format(trans_log.name))
Esempio n. 3
0
def review_plan(crop, seeding, transplant, harvest):
    alert("Review the following information before it is published.")
    msg_fmt = "{: <20}{: >20}"
    message(msg_fmt.format("Planting:", crop), color=colorama.Fore.GREEN)
    message(
        msg_fmt.format("Seeding Date:", seeding['date'].strftime("%Y-%m-%d")))
    message(msg_fmt.format("Seeding Location:", seeding['location']))
    message(msg_fmt.format("Seeds Needed:", seeding['seeds']))
    message(msg_fmt.format("Seed Lot:", seeding['lot']))
    message(msg_fmt.format("Done:", str(seeding['done'])))
    if transplant['date']:
        message("Transplant:", color=colorama.Fore.GREEN)
        message(
            msg_fmt.format("Date:", transplant['date'].strftime("%Y-%m-%d")))
        message(msg_fmt.format("Location:", transplant['location']))
        message(msg_fmt.format("Done:", str(transplant['done'])))
    if harvest['date']:
        message("Harvest", color=colorama.Fore.GREEN)
        message(msg_fmt.format("Date:", harvest['date'].strftime("%Y-%m-%d")))
        message(msg_fmt.format("Done:", str(harvest['done'])))
    return prompt_yes_no("Publish Planting?")
Esempio n. 4
0
def create_harvest(farm, planting, harvest):
    harvest_log = farm.create_harvest(
        planting, datetime.combine(harvest['date'], datetime.min.time()), None,
        harvest['done'])
    message("Created Harvest: {}".format(harvest_log.name))
Esempio n. 5
0
def create_planting(farm: Farm, crop: Crop, season: str, location: str):
    planting = farm.create_planting(crop, season, location)
    message("Created Planting: {}".format(planting.name))
    return planting