menu/lcdmenu.py
def create_menu_item(title, description, action=None,
                     refresh_rate=REFRESH_SLOW):
    """Create a menu item data structure, returning it. Both title and
    description may be strings (or things that can be turned into strings),
    or a function that returns a string
    :param title: The title of the menu item, a function taking MenuState as
    argument
    :param description: The description of the menu item, a function taking
    MenuState as argument
    :param action: A function with a single argument of the MenuState, which
    may perform arbitrary work
    :param refresh_rate: The rate at which this menu item is re-evaluated and
    redrawn on the LCD display, expressed as a number of times per second
    :type refresh_rate: float"""

    title_resolved = title if callable(title) else lambda _: str(title)
    description_resolved = description if callable(description) \
        else lambda _: str(description)

    return {ID: uuid4(),
            TITLE: title_resolved,
            DESCRIPTION: description_resolved,
            REFRESH_RATE: refresh_rate,
            ACTION: action,
            PREV: None,
            NEXT: None}
Create a menu item data structure, returning it. Both title and
    description may be strings (or things that can be turned into strings),
    or a function that returns a string
    :param title: The title of the menu item, a function taking MenuState as
    argument
    :param description: The description of the menu item, a function taking
    MenuState as argument
    :param action: A function with a single argument of the MenuState, which
    may perform arbitrary work
    :param refresh_rate: The rate at which this menu item is re-evaluated and
    redrawn on the LCD display, expressed as a number of times per second
    :type refresh_rate: float
Create a menu item data structure, returning it. Both title and
description may be strings (or things that can be turned into strings),
or a function that returns a string
Create a menu item data structure returning it . Both title and description may be strings ( or things that can be turned into strings ) or a function that returns a string
def create_menu_item(title, description, action=None,
                     refresh_rate=REFRESH_SLOW):
    title_resolved = title if callable(title) else lambda _: str(title)
    description_resolved = description if callable(description) \
        else lambda _: str(description)
    return {ID: uuid4(),
            TITLE: title_resolved,
            DESCRIPTION: description_resolved,
            REFRESH_RATE: refresh_rate,
            ACTION: action,
            PREV: None,
            NEXT: None}
def create_menu_item ( title , description , action = None , refresh_rate = REFRESH_SLOW ) : title_resolved = title if callable ( title ) else lambda _ : str ( title ) description_resolved = description if callable ( description ) else lambda _ : str ( description ) return { ID : uuid4 ( ) , TITLE : title_resolved , DESCRIPTION : description_resolved , REFRESH_RATE : refresh_rate , ACTION : action , PREV : None , NEXT : None }
Create a menu item data structure, returning it.
Create a menu item data structure returning it .
"""Create a menu item data structure, returning it. Both title and
    description may be strings (or things that can be turned into strings),
    or a function that returns a string
    :param title: The title of the menu item, a function taking MenuState as
    argument
    :param description: The description of the menu item, a function taking
    MenuState as argument
    :param action: A function with a single argument of the MenuState, which
    may perform arbitrary work
    :param refresh_rate: The rate at which this menu item is re-evaluated and
    redrawn on the LCD display, expressed as a number of times per second
    :type refresh_rate: float"""
title
The title of the menu item, a function taking MenuState as
argument
The title of the menu item a function taking MenuState as argument
description
The description of the menu item, a function taking
MenuState as argument
The description of the menu item a function taking MenuState as argument
action
A function with a single argument of the MenuState, which
may perform arbitrary work
A function with a single argument of the MenuState which may perform arbitrary work
refresh_rate
The rate at which this menu item is re-evaluated and
redrawn on the LCD display, expressed as a number of times per second
The rate at which this menu item is re - evaluated and redrawn on the LCD display expressed as a number of times per second