Skip to content

Commit 43f6cf3

Browse files
committed
changed colors
1 parent 2e8cbdf commit 43f6cf3

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/meshcore_cli/meshcore_cli.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,15 @@
3434
# Ansi colors
3535
ANSI_END = "\033[0m"
3636
ANSI_GREEN = "\033[0;32m"
37+
ANSI_BGREEN = "\033[1;32m"
3738
ANSI_BLUE = "\033[0;34m"
39+
ANSI_BBLUE = "\033[1;34m"
3840
ANSI_YELLOW = "\033[0;33m"
3941
ANSI_RED = "\033[0;31m"
4042
ANSI_MAGENTA = "\033[0;35m"
43+
ANSI_BMAGENTA = "\033[1;35m"
4144
ANSI_CYAN = "\033[0;36m"
45+
ANSI_BCYAN = "\033[1;36m"
4246
ANSI_LIGHT_BLUE = "\033[0;94m"
4347
ANSI_LIGHT_GREEN = "\033[0;92m"
4448
ANSI_LIGHT_YELLOW = "\033[0;93m"
@@ -99,15 +103,15 @@ async def process_event_message(mc, ev, json_output, end="\n", above=False):
99103
name = ct["adv_name"]
100104

101105
if ct["type"] == 3 : # room
102-
disp = f"{ANSI_CYAN}"
106+
disp = f"{ANSI_BCYAN}"
103107
elif ct["type"] == 2 : # repeater
104-
disp = f"{ANSI_MAGENTA}"
108+
disp = f"{ANSI_BMAGENTA}"
105109
else:
106-
disp = f"{ANSI_GREEN}"
110+
disp = f"{ANSI_BBLUE}"
107111
disp = disp + f"{name}"
108112
if 'signature' in data:
109113
sender = mc.get_contact_by_key_prefix(data['signature'])
110-
disp = disp + f"/{ANSI_GREEN}{sender['adv_name']}"
114+
disp = disp + f"/{ANSI_BBLUE}{sender['adv_name']}"
111115
disp = disp + f" {ANSI_YELLOW}({path_str})"
112116
if data["txt_type"] == 1:
113117
disp = disp + f"{ANSI_LIGHT_GRAY}"
@@ -125,7 +129,7 @@ async def process_event_message(mc, ev, json_output, end="\n", above=False):
125129

126130
elif (data['type'] == "CHAN") :
127131
path_str = f" {ANSI_YELLOW}({path_str}){ANSI_END}"
128-
disp = f"{ANSI_GREEN}ch{data['channel_idx']}{path_str}"
132+
disp = f"{ANSI_BGREEN}ch{data['channel_idx']}{path_str}"
129133
disp = disp + f"{ANSI_END}"
130134
disp = disp + f": {data['text']}"
131135

@@ -256,7 +260,14 @@ def _(event):
256260
prompt = ""
257261
if not last_ack:
258262
prompt = prompt + f"{ANSI_RED}!"
259-
prompt = prompt + f"{ANSI_BLUE}{contact['adv_name']}>{ANSI_END} "
263+
264+
if contact["type"] == 3 : # room server
265+
prompt = prompt + f"{ANSI_CYAN}"
266+
elif contact["type"] == 2 :
267+
prompt = prompt + f"{ANSI_MAGENTA}"
268+
else :
269+
prompt = prompt + f"{ANSI_BLUE}"
270+
prompt = prompt + f"{contact['adv_name']}>{ANSI_END} "
260271

261272
if not process_event_message.color :
262273
prompt=escape_ansi(prompt)

0 commit comments

Comments
 (0)