meshcore-cli 1.2.8__tar.gz → 1.2.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcore-cli
3
- Version: 1.2.8
3
+ Version: 1.2.10
4
4
  Summary: Command line interface to meshcore companion radios
5
5
  Project-URL: Homepage, https://github.com/fdlamotte/meshcore-cli
6
6
  Project-URL: Issues, https://github.com/fdlamotte/meshcore-cli/issues
@@ -10,7 +10,7 @@ License-File: LICENSE
10
10
  Classifier: Operating System :: OS Independent
11
11
  Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: >=3.10
13
- Requires-Dist: meshcore>=2.1.22
13
+ Requires-Dist: meshcore>=2.1.23
14
14
  Requires-Dist: prompt-toolkit>=3.0.50
15
15
  Requires-Dist: pycryptodome
16
16
  Requires-Dist: requests>=2.28.0
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "meshcore-cli"
7
- version = "1.2.8"
7
+ version = "1.2.10"
8
8
  authors = [
9
9
  { name="Florent de Lamotte", email="florent@frizoncorrea.fr" },
10
10
  ]
@@ -17,7 +17,7 @@ classifiers = [
17
17
  ]
18
18
  license = "MIT"
19
19
  license-files = ["LICEN[CS]E*"]
20
- dependencies = [ "meshcore >= 2.1.22", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0", "pycryptodome" ]
20
+ dependencies = [ "meshcore >= 2.1.23", "prompt_toolkit >= 3.0.50", "requests >= 2.28.0", "pycryptodome" ]
21
21
 
22
22
  [project.urls]
23
23
  Homepage = "https://github.com/fdlamotte/meshcore-cli"
@@ -4,7 +4,7 @@
4
4
  """
5
5
 
6
6
  import asyncio
7
- import os, sys, io
7
+ import os, sys, io, platform
8
8
  import time, datetime
9
9
  import getopt, json, shlex, re
10
10
  import logging
@@ -33,7 +33,7 @@ import re
33
33
  from meshcore import MeshCore, EventType, logger
34
34
 
35
35
  # Version
36
- VERSION = "v1.2.8"
36
+ VERSION = "v1.2.10"
37
37
 
38
38
  # default ble address is stored in a config file
39
39
  MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
@@ -76,6 +76,15 @@ ANSI_BORANGE="\033[1;38;5;214m"
76
76
  ANSI_YELLOW = "\033[0;33m"
77
77
  ANSI_BYELLOW = "\033[1;33m"
78
78
 
79
+ #Unicode chars
80
+ # some possible symbols for prompts 🭬🬛🬗🭬🬛🬃🬗🭬🬛🬃🬗🬏🭀🭋🭨🮋
81
+ ARROW_TAIL = "🭨"
82
+ ARROW_HEAD = "🭬"
83
+
84
+ if platform.system() == 'Windows' or platform.system() == 'Darwin':
85
+ ARROW_TAIL = ""
86
+ ARROW_HEAD = " "
87
+
79
88
  def escape_ansi(line):
80
89
  ansi_escape = re.compile(r'(?:\x1B[@-_]|[\x80-\x9F])[0-?]*[ -/]*[@-~]')
81
90
  return ansi_escape.sub('', line)
@@ -762,7 +771,6 @@ Line starting with \"$\" or \".\" will issue a meshcli command.
762
771
  else:
763
772
  prompt = f"{ANSI_INVERT}"
764
773
 
765
- # some possible symbols for prompts 🭬🬛🬗🭬🬛🬃🬗🭬🬛🬃🬗🬏🭀🭋🭨🮋
766
774
  if print_name or contact is None :
767
775
  prompt = prompt + f"{ANSI_BGRAY}"
768
776
  prompt = prompt + f"{mc.self_info['name']}"
@@ -772,7 +780,7 @@ Line starting with \"$\" or \".\" will issue a meshcli command.
772
780
  if classic :
773
781
  prompt = prompt + " > "
774
782
  else :
775
- prompt = prompt + f"{ANSI_NORMAL}🭬{ANSI_INVERT}"
783
+ prompt = prompt + f"{ANSI_NORMAL}{ARROW_HEAD}{ANSI_INVERT}"
776
784
 
777
785
  if not contact is None :
778
786
  if not last_ack:
@@ -793,7 +801,7 @@ Line starting with \"$\" or \".\" will issue a meshcli command.
793
801
  prompt = prompt + f"{ANSI_INVERT}"
794
802
 
795
803
  if print_name and not classic :
796
- prompt = prompt + f"{ANSI_NORMAL}🭨{ANSI_INVERT}"
804
+ prompt = prompt + f"{ANSI_NORMAL}{ARROW_TAIL}{ANSI_INVERT}"
797
805
 
798
806
  prompt = prompt + f"{contact['adv_name']}"
799
807
  if contact["type"] == 0 or contact["out_path_len"]==-1:
@@ -810,7 +818,7 @@ Line starting with \"$\" or \".\" will issue a meshcli command.
810
818
  if classic :
811
819
  prompt = prompt + f"{ANSI_NORMAL} > "
812
820
  else:
813
- prompt = prompt + f"{ANSI_NORMAL}🭬"
821
+ prompt = prompt + f"{ANSI_NORMAL}{ARROW_HEAD}"
814
822
 
815
823
  prompt = prompt + f"{ANSI_END}"
816
824
 
@@ -1604,6 +1612,7 @@ async def print_disc_trace_to (mc, contact):
1604
1612
 
1605
1613
  async def next_cmd(mc, cmds, json_output=False):
1606
1614
  """ process next command """
1615
+ global ARROW_TAIL, ARROW_HEAD
1607
1616
  try :
1608
1617
  argnum = 0
1609
1618
 
@@ -1737,6 +1746,10 @@ async def next_cmd(mc, cmds, json_output=False):
1737
1746
  interactive_loop.classic = (cmds[2] == "on")
1738
1747
  if json_output :
1739
1748
  print(json.dumps({"cmd" : cmds[1], "param" : cmds[2]}))
1749
+ case "arrow_tail":
1750
+ ARROW_TAIL = cmds[2]
1751
+ case "arrow_head":
1752
+ ARROW_HEAD = cmds[2]
1740
1753
  case "color" :
1741
1754
  process_event_message.color = (cmds[2] == "on")
1742
1755
  if json_output :
@@ -2344,7 +2357,7 @@ async def next_cmd(mc, cmds, json_output=False):
2344
2357
  if classic :
2345
2358
  print("→",end="")
2346
2359
  else :
2347
- print(f"{ANSI_NORMAL}🭬",end="")
2360
+ print(f"{ANSI_NORMAL}{ARROW_HEAD}",end="")
2348
2361
  print(ANSI_END, end="")
2349
2362
  if "hash" in t:
2350
2363
  print(f"[{t['hash']}]",end="")
File without changes
File without changes
File without changes
File without changes
File without changes