示例#1
0
文件: pingtop.py 项目: tianhm/pingtop
def get_palette():
    attr_entries = {}
    for attr in ["dark red", "dark green", "dark blue"]:
        attr_entries[attr.split()[1]] = PaletteEntry(mono="white",
                                                     foreground=attr,
                                                     background="black")
    entries = DataTable.get_palette_entries(user_entries=attr_entries)
    palette = Palette("default", **entries)
    return palette
示例#2
0
from panwid.datatable import DataTable
import click

from wiredolphin.pantable import table
from wiredolphin.shark import capture_memeory_packets

logger = logging.getLogger(__name__)

event_loop = asyncio.get_event_loop()
screen = urwid.raw_display.Screen()
screen.set_terminal_properties(256)
attr_entries = {}

for attr in ["dark red", "dark green", "dark blue"]:
    attr_entries[attr.split()[1]] = PaletteEntry(mono="white",
                                                 foreground=attr,
                                                 background="black")
entries = DataTable.get_palette_entries(user_entries=attr_entries)
palette = Palette("default", **entries)

label = "Filter:"
help_text = "Use <Ctrl p> to focus on Filter."
pile = urwid.Pile([("pack", urwid.Edit(label)),
                   ("pack", urwid.Divider("\N{HORIZONTAL BAR}")),
                   ("weight", 1, table),
                   ("pack", urwid.Divider("\N{HORIZONTAL BAR}")),
                   ("pack", urwid.Text(help_text))])


def global_input(key):
    if key in ('q', 'Q'):
示例#3
0
from ..thirdparty import panwid
from urwid_utils.palette import Palette, PaletteEntry

__all__ = ["PALETTE"]


PALETTE = Palette("default",
                  **panwid.listbox.ScrollingListBox.get_palette_entries(),
                  **panwid.DataTable.get_palette_entries(
                      user_entries={
                          "table_row_body highlight": PaletteEntry(
                              mono="white",
                              foreground="white",
                              background="dark red"
                          ),
                          "table_row_body focused": PaletteEntry(
                              mono="white",
                              foreground="white",
                              background="dark gray"
                          )
                      }
                  ))
PALETTE += [
    ("body", "white", "", "standout"),
    ("header", "white", "dark red", "bold"),
    ("button normal", "light gray", "dark blue", "standout"),
    ("title", "white", "black"),
    ("exit", "white", "dark blue")
]