Exemplo n.º 1
0
Arquivo: app.py Projeto: 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
Exemplo n.º 2
0
Arquivo: app.py Projeto: 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
Exemplo n.º 3
0
Arquivo: app.py Projeto: 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']
Exemplo n.º 4
0
Arquivo: app.py Projeto: 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']
Exemplo n.º 5
0
Arquivo: app.py Projeto: 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
Exemplo n.º 6
0
Arquivo: app.py Projeto: 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"]