remove relog parameter

master
magical 2022-08-06 05:27:37 +00:00
parent 3e4f3de2a8
commit ceb4937c60
1 changed files with 10 additions and 12 deletions

View File

@ -1156,7 +1156,7 @@ class App(object):
call("clear", shell=True)
print(welcome)
try:
log_in(relog=True)
log_in()
except (KeyboardInterrupt, InterruptedError):
pass
self.loop.start()
@ -2395,17 +2395,15 @@ def nameloop(prompt, positive):
return name
def log_in(relog=False, name="", password=""):
def log_in(name="", password=""):
"""
Handles login or registration using an oldschool input()
chain. The user is run through this before starting the
curses app. A default name and password can be passed in
if relog is False.
Handles login or registration. If name and/or password are not
provided, the user is prompted for them using an oldschool
input() chain. The user is run through this before starting the
curses app.
"""
if relog:
if not name:
name = sane_value("user_name", "Username", return_empty=True)
else:
name = name or sane_value("user_name", "Username", return_empty=True)
if name == "":
motherfucking_rainbows("~~W3 4R3 4n0nYm0u5~~")
else:
@ -2414,7 +2412,7 @@ def log_in(relog=False, name="", password=""):
try:
network.set_credentials(
name,
password if not relog else ""
password if name and password else ""
)
# make it easy for people who use an empty password =)
motherfucking_rainbows("~~welcome back {}~~".format(network.user_name))
@ -2582,9 +2580,9 @@ def main():
motherfucking_rainbows(obnoxious_logo)
print(welcome)
try:
user_name = get_arg("user") or os.getenv("BBJ_USER")
name = get_arg("user") or os.getenv("BBJ_USER")
password = os.getenv("BBJ_PASSWORD", default="")
log_in(name=user_name, password=password)
log_in(name, password)
app.index()
app.loop.run()
except (InterruptedError, KeyboardInterrupt):