MCPcopy Create free account
hub / github.com/CaliDog/certstream-python / CertStreamGui

Class CertStreamGui

examples/gui.py:37–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35]
36
37class CertStreamGui(object):
38 INTRO_MESSAGE = u"""
39 _____ _ _____ _
40 / ____| | | / ____| |
41 | | ___ _ __| |_| (___ | |_ _ __ ___ __ _ _ __ ___
42 | | / _ \ '__| __|\___ \| __| '__/ _ \/ _` | '_ ` _ \
43 | |___| __/ | | |_ ____) | |_| | | __/ (_| | | | | | |
44 \_____\___|_| \__|_____/ \__|_| \___|\__,_|_| |_| |_|
45
46Welcome to CertStream CLI 1.0!
47
48We're waiting on certificates to come in, so hold tight!
49
50Protip: Looking for the old CertStream CLI behavior? Use the --grep flag!
51
52{}
53 """
54
55 COUNTER_FORMAT = u"┤ {}/{} ├"
56
57 FOOTER_START = "Certstream 1.0 | "
58
59 HEARTBEAT_ICON = u'\u2764'
60
61 def __init__(self):
62 self.message_queue = Queue.Queue()
63 self.message_list = []
64 self.counter_text = urwid.Text(self.COUNTER_FORMAT.format('0', '0'))
65 self.seen_message = False
66 self._heartbeat_is_animating = False
67 self.setup_widgets()
68 self.setup_certstream_listener()
69 self._animate_waiter()
70
71
72 def setup_widgets(self):
73 self.intro_frame = urwid.LineBox(
74 urwid.Filler(
75 urwid.Text(('body_text', self.INTRO_MESSAGE.format("")), align=urwid.CENTER),
76 valign=urwid.MIDDLE,
77 )
78 )
79
80 self.frame = urwid.Frame(
81 body=self.intro_frame,
82 footer=urwid.Text(
83 [self.FOOTER_START, ('heartbeat_inactive', self.HEARTBEAT_ICON)],
84 align=urwid.CENTER
85 )
86 )
87
88 self.loop = urwid.MainLoop(
89 urwid.AttrMap(self.frame, 'body_text'),
90 unhandled_input=show_or_exit,
91 palette=PALETTE,
92 )
93
94 self.list_walker = urwid.SimpleListWalker(self.message_list)

Callers 1

gui.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected