Skip to content

Commit

Permalink
app: don't show intro if not a TTY
Browse files Browse the repository at this point in the history
  • Loading branch information
koreno committed Sep 5, 2018
1 parent fac216a commit f30d0c1
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions termenu/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import re
import time
import functools
Expand Down Expand Up @@ -50,21 +51,21 @@ def __init__(self, message="", *args, **kwargs):
f = open(CFG_PATH, "w")
f.write(DEFAULT_CONFIG)
app_chars = DEFAULT_CONFIG
if sys.__stdin__.isatty():
os.system("clear")
print(Colorized(dedent("""
os.system("clear")
print(Colorized(dedent("""
WHITE<<~/.termenu/app_chars.py:>>
RED<<.-~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~-.>>
{DEFAULT_CONFIG}
RED<<'*-~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~o~O~o~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~-*'>>
DARK_YELLOW<<(Hit any key to proceed...)>>""").format(DEFAULT_CONFIG=DEFAULT_CONFIG)), end="")

WHITE<<~/.termenu/app_chars.py:>>
RED<<.-~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~-.>>
{DEFAULT_CONFIG}
RED<<'*-~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~o~O~o~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~~~<>~~-*'>>
DARK_YELLOW<<(Hit any key to proceed...)>>""").format(DEFAULT_CONFIG=DEFAULT_CONFIG)), end="")

try:
next(keyboard.keyboard_listener())
except KeyboardInterrupt:
pass
print(Colorized("\rDARK_GREEN<<(Proceeding...)>>" + " " * 40))
try:
next(keyboard.keyboard_listener())
except KeyboardInterrupt:
pass
print(Colorized("\rDARK_GREEN<<(Proceeding...)>>" + " " * 40))


APP_CHARS = {}
Expand Down

0 comments on commit f30d0c1

Please sign in to comment.