meshcore-cli 1.2.13__py3-none-any.whl → 1.2.14__py3-none-any.whl

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.
@@ -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
@@ -32,7 +32,7 @@ import re
32
32
  from meshcore import MeshCore, EventType, logger
33
33
 
34
34
  # Version
35
- VERSION = "v1.2.13"
35
+ VERSION = "v1.2.14"
36
36
 
37
37
  # default ble address is stored in a config file
38
38
  MCCLI_CONFIG_DIR = str(Path.home()) + "/.config/meshcore/"
@@ -1036,7 +1036,10 @@ Line starting with \"$\" or \".\" will issue a meshcli command.
1036
1036
  except asyncio.CancelledError:
1037
1037
  # Handle task cancellation from KeyboardInterrupt in asyncio.run()
1038
1038
  print("Exiting cli")
1039
- interactive_loop.classic = False
1039
+ if platform.system() == "Darwin" or platform.system() == "Windows":
1040
+ interactive_loop.classic = True
1041
+ else:
1042
+ interactive_loop.classic = False
1040
1043
 
1041
1044
  async def process_contact_chat_line(mc, contact, line):
1042
1045
  if contact["type"] == 0:
@@ -2337,12 +2340,11 @@ async def next_cmd(mc, cmds, json_output=False):
2337
2340
  else :
2338
2341
  color = process_event_message.color
2339
2342
  classic = interactive_loop.classic or not color
2340
- print("]",end="")
2341
2343
  for t in ev.payload["path"]:
2342
2344
  if classic :
2343
2345
  print("→",end="")
2344
2346
  else:
2345
- print(f" {ANSI_INVERT}", end="")
2347
+ print(f"{ANSI_INVERT}", end="")
2346
2348
  snr = t['snr']
2347
2349
  if color:
2348
2350
  if snr >= 10 :
@@ -2355,13 +2357,13 @@ async def next_cmd(mc, cmds, json_output=False):
2355
2357
  if classic :
2356
2358
  print("→",end="")
2357
2359
  else :
2358
- print(f"{ANSI_NORMAL}{ARROW_HEAD} ",end="")
2360
+ print(f"{ANSI_NORMAL}{ARROW_HEAD}",end="")
2359
2361
  if color:
2360
2362
  print(ANSI_END, end="")
2361
2363
  if "hash" in t:
2362
2364
  print(f"[{t['hash']}]",end="")
2363
2365
  else:
2364
- print("[")
2366
+ print()
2365
2367
 
2366
2368
  case "login" | "l" :
2367
2369
  argnum = 2
@@ -3131,6 +3133,7 @@ def usage () :
3131
3133
  -D : debug
3132
3134
  -S : scan for devices and show a selector
3133
3135
  -l : list available ble/serial devices and exit
3136
+ -C : toggles classic mode for prompt
3134
3137
  -c <on/off> : disables most of color output if off
3135
3138
  -T <timeout> : timeout for the ble scan (-S and -l) default 2s
3136
3139
  -a <address> : specifies device address (can be a name)
@@ -3199,12 +3202,14 @@ async def main(argv):
3199
3202
  with open(MCCLI_ADDRESS, encoding="utf-8") as f :
3200
3203
  address = f.readline().strip()
3201
3204
 
3202
- opts, args = getopt.getopt(argv, "a:d:s:ht:p:b:fjDhvSlT:Pc:")
3205
+ opts, args = getopt.getopt(argv, "a:d:s:ht:p:b:fjDhvSlT:Pc:C")
3203
3206
  for opt, arg in opts :
3204
3207
  match opt:
3205
3208
  case "-c" :
3206
3209
  if arg == "off":
3207
3210
  process_event_message.color = False
3211
+ case "-C":
3212
+ interactive_loop.classic = not interactive_loop.classic
3208
3213
  case "-d" : # name specified on cmdline
3209
3214
  address = arg
3210
3215
  case "-a" : # address specified on cmdline
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcore-cli
3
- Version: 1.2.13
3
+ Version: 1.2.14
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
@@ -0,0 +1,8 @@
1
+ meshcore_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ meshcore_cli/__main__.py,sha256=PfYgibmu2LEtC-OV7L1UgmvV3swJ5rQ4bbXHlwUFlgE,83
3
+ meshcore_cli/meshcore_cli.py,sha256=NbE3xX0GE3dtq0WnlBdF79iwyeGnxHerFGGoQNLeDSc,141395
4
+ meshcore_cli-1.2.14.dist-info/METADATA,sha256=DDHsEo0JnY32-PX5_tr3qUYagxHJfJ9eSqYn5FJkrdw,11658
5
+ meshcore_cli-1.2.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
+ meshcore_cli-1.2.14.dist-info/entry_points.txt,sha256=77V29Pyth11GteDk7tneBN3MMk8JI7bTlS-BGSmxCmI,103
7
+ meshcore_cli-1.2.14.dist-info/licenses/LICENSE,sha256=F9s987VtS0AKxW7LdB2EkLMkrdeERI7ICdLJR60A9M4,1066
8
+ meshcore_cli-1.2.14.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- meshcore_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- meshcore_cli/__main__.py,sha256=PfYgibmu2LEtC-OV7L1UgmvV3swJ5rQ4bbXHlwUFlgE,83
3
- meshcore_cli/meshcore_cli.py,sha256=f5T9-BokGud7XQoSvuSh-h0bY5bA9UeLudPBTYiuQEo,141172
4
- meshcore_cli-1.2.13.dist-info/METADATA,sha256=ZrvQ-6jV_2NsHEiUNuTV1mTUq3cjogq37hGDaHjzRhw,11658
5
- meshcore_cli-1.2.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
6
- meshcore_cli-1.2.13.dist-info/entry_points.txt,sha256=77V29Pyth11GteDk7tneBN3MMk8JI7bTlS-BGSmxCmI,103
7
- meshcore_cli-1.2.13.dist-info/licenses/LICENSE,sha256=F9s987VtS0AKxW7LdB2EkLMkrdeERI7ICdLJR60A9M4,1066
8
- meshcore_cli-1.2.13.dist-info/RECORD,,