Update prompts: 'r' option first, add 'q' to node selection
This commit is contained in:
1 parent
15f72214c9
commit
a00901efdc
1 file changed
+7
-4
@@ -117,7 +117,7 @@ class MeshtasticCLI:
|
|||||||
"""Prompt user to select and connect to a radio"""
|
"""Prompt user to select and connect to a radio"""
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
choice = input("\nEnter number to connect (or 'q' to quit, 'r' to refresh): ").strip()
|
choice = input("\nEnter number to connect ('r' to retry, 'q' to quit): ").strip()
|
||||||
if choice.lower() == 'q':
|
if choice.lower() == 'q':
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
elif choice.lower() == 'r':
|
elif choice.lower() == 'r':
|
||||||
@@ -230,7 +230,7 @@ class MeshtasticCLI:
|
|||||||
self.messages.append(msg)
|
self.messages.append(msg)
|
||||||
# Print new messages in real-time
|
# Print new messages in real-time
|
||||||
if self.current_mode == "messaging":
|
if self.current_mode == "messaging":
|
||||||
time_str = msg['time'].strftime('%Y-%m-%d %H:%M:%S')
|
time_str = msg['time'].strftime('%Y-%m-d %H:%M:%S')
|
||||||
print(f"\n[{time_str}] {msg['from']} ({msg['from_short']}) -> {msg['to']} ({msg['to_short']}): {msg['text']}")
|
print(f"\n[{time_str}] {msg['from']} ({msg['from_short']}) -> {msg['to']} ({msg['to_short']}): {msg['text']}")
|
||||||
print("> ", end='', flush=True)
|
print("> ", end='', flush=True)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -266,9 +266,12 @@ class MeshtasticCLI:
|
|||||||
"""Prompt user to select a contact"""
|
"""Prompt user to select a contact"""
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
choice = input("\nEnter number to message (or 'b' for broadcast, 'r' to refresh): ").strip()
|
choice = input("\nEnter number to message ('r' to refresh, 'b' for broadcast, 'q' to quit): ").strip()
|
||||||
|
|
||||||
if choice.lower() == 'b':
|
if choice.lower() == 'q':
|
||||||
|
self.exit_program()
|
||||||
|
return False
|
||||||
|
elif choice.lower() == 'b':
|
||||||
self.selected_node = None
|
self.selected_node = None
|
||||||
print("Broadcasting to all nodes")
|
print("Broadcasting to all nodes")
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in new issue
Block a user