# Path: sen/tui/constants.py
# MAIN_LIST_FOCUS = "main_list_focus"
# 
# Path: sen/tui/widgets/responsive_column.py
# class ResponsiveColumns(urwid.Columns):
#     """
#     Widgets arranged horizontally in columns from left to right
#     """
# 
#     def column_widths(self, size, focus=False):
#         """
#         Return a list of column widths.
# 
#         0 values in the list mean hide corresponding column completely
#         """
#         maxcol = size[0]
#         self._cache_maxcol = maxcol
#         widths = [width for i, (w, (t, width, b)) in enumerate(self.contents)]
#         self._cache_column_widths = widths
# 
#         return widths
# 
# Path: sen/tui/widgets/util.py
# class SelectableText(ColorTextMixin, AdHocAttrMap):
#     def __init__(self, text, maps=None):
#         maps = maps or get_map()
#         super().__init__(urwid.Text(text, align="left", wrap="clip"), maps)
# 
# def get_map(defult="main_list_dg"):
#     return {"normal": defult, "focus": MAIN_LIST_FOCUS}


import datetime
import logging
import urwid
from sen.tui.constants import MAIN_LIST_FOCUS
from sen.tui.widgets.responsive_column import ResponsiveColumns
from sen.tui.widgets.util import SelectableText, get_map
        if took < 500:
            text_list.append(("notif_text_yellow", command_took_str))
        elif took < 1000:
            text_list.append(("notif_text_orange", command_took_str))
        else:
            command_took_str = "{:.2f}".format(took / 1000.0)
            text_list.append(("notif_text_red", command_took_str))
            text_list.append((attr, " s"))
        if took < 1000:
            text_list.append((attr, " ms"))
    elif display_always:
        text_list.append((attr, operation.pretty_message))
    else:
        return
    return urwid.AttrMap(urwid.Text(text_list), attr)


def get_time_attr_map(t):
    """
                                                       now -> |
                            hour ago -> |
        day ago -> |
    |--------------|--------------------|---------------------|
    """
    now = datetime.datetime.now()
    if t + datetime.timedelta(hours=3) > now:
        return get_map("main_list_white")
    if t + datetime.timedelta(days=3) > now:
        return get_map("main_list_lg")
    else:

# Path: sen/tui/constants.py
# MAIN_LIST_FOCUS = "main_list_focus"
# 
# Path: sen/tui/widgets/responsive_column.py
# class ResponsiveColumns(urwid.Columns):
#     """
#     Widgets arranged horizontally in columns from left to right
#     """
# 
#     def column_widths(self, size, focus=False):
#         """
#         Return a list of column widths.
# 
#         0 values in the list mean hide corresponding column completely
#         """
#         maxcol = size[0]
#         self._cache_maxcol = maxcol
#         widths = [width for i, (w, (t, width, b)) in enumerate(self.contents)]
#         self._cache_column_widths = widths
# 
#         return widths
# 
# Path: sen/tui/widgets/util.py
# class SelectableText(ColorTextMixin, AdHocAttrMap):
#     def __init__(self, text, maps=None):
#         maps = maps or get_map()
#         super().__init__(urwid.Text(text, align="left", wrap="clip"), maps)
# 
# def get_map(defult="main_list_dg"):
#     return {"normal": defult, "focus": MAIN_LIST_FOCUS}


# Path: sen/tui/widgets/list/util.py
import datetime
import logging
import urwid
from sen.tui.constants import MAIN_LIST_FOCUS
from sen.tui.widgets.responsive_column import ResponsiveColumns
from sen.tui.widgets.util import SelectableText, get_map

        if took < 500:
            text_list.append(("notif_text_yellow", command_took_str))
        elif took < 1000:
            text_list.append(("notif_text_orange", command_took_str))
        else:
            command_took_str = "{:.2f}".format(took / 1000.0)
            text_list.append(("notif_text_red", command_took_str))
            text_list.append((attr, " s"))
        if took < 1000:
            text_list.append((attr, " ms"))
    elif display_always:
        text_list.append((attr, operation.pretty_message))
    else:
        return
    return urwid.AttrMap(urwid.Text(text_list), attr)


def get_time_attr_map(t):
    """
                                                       now -> |
                            hour ago -> |
        day ago -> |
    |--------------|--------------------|---------------------|
    """
    now = datetime.datetime.now()
    if t + datetime.timedelta(hours=3) > now:
        return get_map("main_list_white")
    if t + datetime.timedelta(days=3) > now:
        return get_map("main_list_lg")
    else:

        return get_map("main_list_dg")