maybe fix some exit problems

This commit is contained in:
nebula 2025-04-23 22:57:29 +00:00
parent 0cbeb75a30
commit b375af7298

13
bink.py
View File

@ -57,23 +57,24 @@ def generate_feed(before=None, count=200):
if len(sys.argv) > 1:
if sys.argv[1] == "--help" or sys.argv[1] == "-h":
exit(helptext)
print(helptext)
exit(0)
elif sys.argv[1] == "--dump":
with open("/dev/stdout", "w") as f:
json.dump(generate_feed(), f)
exit()
exit(0)
elif sys.argv[1] == "--pipe":
try:
with open("/dev/stdin", "r", encoding="UTF-8") as f:
body = f.read().strip()
if body:
create_post(body)
exit()
exit(0)
except KeyboardInterrupt:
exit()
exit(0)
else:
create_post(" ".join(sys.argv[1:]))
exit()
exit(0)
import urwid
@ -128,7 +129,7 @@ class App():
def exit(self, message=""):
app.loop.stop()
run(["clear"])
exit(message)
exit(0)
class ActionBox(urwid.ListBox):
def keypress(self, size, key):