Who even needs a window manager anyway
This commit is contained in:
parent
d74b40b7e2
commit
e89b964d27
|
@ -1,15 +1,30 @@
|
||||||
import urwid
|
import time
|
||||||
|
import logging
|
||||||
|
import verboselogs
|
||||||
|
import coloredlogs
|
||||||
|
|
||||||
|
verboselogs.install()
|
||||||
|
|
||||||
|
# Create a logger object.
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
# By default the install() function installs a handler on the root logger,
|
||||||
|
# this means that log messages from your code and log messages from the
|
||||||
|
# libraries that you use will all show up on the terminal.
|
||||||
|
coloredlogs.install(level='DEBUG')
|
||||||
|
|
||||||
|
|
||||||
def exit_on_q(key):
|
# If you don't want to see log messages from libraries, you can pass a
|
||||||
if key in ('q', 'Q'):
|
# specific logger object to the install() function. In this case only log
|
||||||
raise urwid.ExitMainLoop()
|
# messages originating from that logger will show up on the terminal.
|
||||||
|
coloredlogs.install(level='DEBUG', logger=logger)
|
||||||
|
|
||||||
|
logger.success('Program Started')
|
||||||
|
|
||||||
txt = urwid.BigText(u" Greatness Awaits... ", urwid.HalfBlock5x4Font())
|
# Junk~
|
||||||
test = urwid.Padding(txt, 'center', None)
|
while True:
|
||||||
test = urwid.Filler(test, 'middle', None, 7)
|
try:
|
||||||
|
logger.info('Nothing to do.')
|
||||||
|
time.sleep(1)
|
||||||
loop = urwid.MainLoop(test, unhandled_input=exit_on_q)
|
except KeyboardInterrupt:
|
||||||
loop.run()
|
break
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
urwid
|
coloredlogs
|
||||||
|
verboselogs
|
||||||
|
|
Loading…
Reference in New Issue