Example #1
0
File: app.py Project: bhaney/R1D2
def get_menu():
    d = g.get('day', None)
    fd = first_day_of_this_week()
    if d is None or d != fd:
        g.menu = load_menu()
        g.day = fd
    return g.menu
Example #2
0
File: app.py Project: kdungs/R1D2
def get_menu():
    d = g.get('day', None)
    fd = first_day_of_this_week()
    if d is None or d != fd:
        g.menu = load_menu()
        g.day = d
    return g.menu
Example #3
0
File: app.py Project: bhaney/R1D2
def load_menu():
    db = shelve.get_shelve()
    fd = first_day_of_this_week()
    day = db.get('day', None)
    if day is None or day != fd:
        db['menu'] = r1.get_full_menu()
        db['day'] = fd
    return db['menu']
Example #4
0
File: app.py Project: kdungs/R1D2
def load_menu():
    db = shelve.get_shelve()
    fd = first_day_of_this_week()
    day = db.get('day', None)
    if day is None or day != fd:
        db['menu'] = r1.get_full_menu()
        db['day'] = fd
    return db['menu']
Example #5
0
File: app.py Project: funilrys/R1D2
def get_menu():
    """
    Get/set and return the full menu from the global data.
    """

    current_day = g.get("day", None)
    first_day_of_the_week = first_day_of_this_week()

    if current_day is None or current_day != first_day_of_the_week:
        g.menu = load_menu()
        g.day = current_day

    return g.menu
Example #6
0
File: app.py Project: funilrys/R1D2
def load_menu():
    """
    Get and return the full menu from the database.
    """

    database = shelve.get_shelve()
    first_day_of_the_week = first_day_of_this_week()
    current_day = database.get("day", None)

    if current_day is None or current_day != first_day_of_the_week:
        database["menu"] = get_full_menu()
        database["day"] = first_day_of_the_week

    return database["menu"]