fix flake8 lambda E731
@@ -42,6 +42,10 @@ def write_result(text):
print_formatted_text()
+def get_rprompt():
+ return '<transaction>'
+
+
def repl(client, session, start_time):
command_holder = UserInputCommand()
timer(f"First REPL command enter, time cost: {time.time() - start_time}")
@@ -57,13 +61,12 @@ def repl(client, session, start_time):
_interval = None
try:
- get_rprompt = lambda: '<transaction>' if in_transaction else None
command = session.prompt(
"{hostname}> ".format(hostname=str(client)),
bottom_toolbar=BottomToolbar(command_holder).render,
refresh_interval=_interval,
input_processors=[GetCommandProcessor(command_holder)],
- rprompt=get_rprompt,
+ rprompt=get_rprompt if in_transaction else None,
)
except KeyboardInterrupt:
