yamcs-cli 1.4.12__py3-none-any.whl → 1.4.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.
yamcs/cli/__main__.py CHANGED
@@ -1,9 +1,9 @@
1
1
  import argparse
2
2
  import sys
3
3
  import traceback
4
+ from importlib.metadata import entry_points
4
5
 
5
6
  import argcomplete
6
- import pkg_resources
7
7
  from yamcs.client import Unauthorized
8
8
 
9
9
  from yamcs.cli import utils
@@ -95,8 +95,8 @@ def main():
95
95
  TablesCommand(subparsers)
96
96
 
97
97
  # Discover subcommand plugins
98
- for entry in pkg_resources.iter_entry_points(group="yamcs.cli.subcommands"):
99
- subcommand_cls = entry.load(subparsers)
98
+ for entry in entry_points(group="yamcs.cli.subcommands"):
99
+ subcommand_cls = entry.load()
100
100
  subcommand_cls(subparsers)
101
101
 
102
102
  # Provide bash autocompletion
yamcs/cli/packets.py CHANGED
@@ -41,6 +41,12 @@ class PacketsCommand(utils.Command):
41
41
  type=str,
42
42
  help="Include packets not newer than the specified date",
43
43
  )
44
+ subparser.add_argument(
45
+ "--filter",
46
+ metavar="EXPRESSION",
47
+ type=str,
48
+ help="Apply a filter expression to each packet",
49
+ )
44
50
  subparser.set_defaults(func=self.log)
45
51
 
46
52
  subparser = self.create_subparser(
@@ -93,6 +99,7 @@ class PacketsCommand(utils.Command):
93
99
 
94
100
  iterator = archive.list_packets(
95
101
  name=args.packet,
102
+ filter=args.filter,
96
103
  descending=most_recent_only,
97
104
  start=start,
98
105
  stop=stop,
@@ -1,3 +1,4 @@
1
+ import argparse
1
2
  import sys
2
3
 
3
4
  from yamcs.client import YamcsClient
@@ -23,13 +24,27 @@ class ParameterArchiveCommand(utils.Command):
23
24
  "start",
24
25
  metavar="START",
25
26
  type=str,
26
- help="Start time",
27
+ help=argparse.SUPPRESS, # Deprecated
28
+ nargs="?",
27
29
  )
28
30
  subparser.add_argument(
29
31
  "stop",
30
32
  metavar="STOP",
31
33
  type=str,
32
- help="Stop time",
34
+ help=argparse.SUPPRESS, # Deprecated
35
+ nargs="?",
36
+ )
37
+ subparser.add_argument(
38
+ "-s",
39
+ "--since",
40
+ type=str,
41
+ help="Ignore data before the specified date",
42
+ )
43
+ subparser.add_argument(
44
+ "-u",
45
+ "--until",
46
+ type=str,
47
+ help="Ignore data after the specified date",
33
48
  )
34
49
  subparser = self.create_subparser(
35
50
  subparsers, "purge", "Remove all data from the Parameter Archive"
@@ -52,8 +67,25 @@ class ParameterArchiveCommand(utils.Command):
52
67
  client = YamcsClient(**opts.client_kwargs)
53
68
  archive = client.get_archive(opts.require_instance())
54
69
 
55
- start = utils.parse_timestamp(args.start)
56
- stop = utils.parse_timestamp(args.stop)
70
+ start = None
71
+ if args.start:
72
+ eprint(
73
+ "*** WARNING: deprecated use of positional 'START' argument. "
74
+ "Use --since START instead."
75
+ )
76
+ start = utils.parse_timestamp(args.start)
77
+ elif args.since:
78
+ start = utils.parse_timestamp(args.since)
79
+
80
+ stop = None
81
+ if args.stop:
82
+ eprint(
83
+ "*** WARNING: deprecated use of positional 'STOP' argument. "
84
+ "Use --until STOP instead."
85
+ )
86
+ stop = utils.parse_timestamp(args.stop)
87
+ elif args.until:
88
+ stop = utils.parse_timestamp(args.until)
57
89
 
58
90
  archive.rebuild_parameter_archive(start=start, stop=stop)
59
91
  eprint("Task submitted. It will finish asynchronously.")
yamcs/cli/tables.py CHANGED
@@ -185,11 +185,12 @@ class TablesCommand(utils.Command):
185
185
  if args.dir:
186
186
  path = os.path.join(args.dir, path)
187
187
  if args.gzip:
188
- with gzip.open(path, "rb") as f:
189
- self.read_dump(f, archive, table, path)
188
+ with open(path, "rb") as f:
189
+ with gzip.open(f, "rb") as uncompressed_f:
190
+ self.read_dump(f, uncompressed_f, archive, table, path)
190
191
  else:
191
192
  with open(path, "rb") as f:
192
- self.read_dump(f, archive, table, path)
193
+ self.read_dump(f, f, archive, table, path)
193
194
 
194
195
  def rebuild_histogram(self, args):
195
196
  opts = utils.CommandOptions(args)
@@ -208,7 +209,8 @@ class TablesCommand(utils.Command):
208
209
  sys.stdout.write("done\n")
209
210
  sys.stdout.flush()
210
211
 
211
- def read_dump(self, f, archive, table, path):
212
+ def read_dump(self, f, uncompressed_f, archive, table, path):
213
+ f_progress = 0
212
214
  txsize = 0
213
215
  t0 = time.time()
214
216
  t = t0
@@ -217,26 +219,30 @@ class TablesCommand(utils.Command):
217
219
  fsize = os.path.getsize(path)
218
220
 
219
221
  def report_load_stats(elapsed):
220
- nonlocal path, fsize, txsize
222
+ nonlocal path, fsize, txsize, f_progress
221
223
  rate = (txsize / 1024 / 1024) / elapsed
222
224
  sys.stdout.write(
223
- "\r{}: {:.2f} MB (tx: {:.2f} MB at {:.2f} MB/s)".format(
224
- path, fsize / 1024 / 1024, txsize / 1024 / 1024, rate
225
+ "\r{}: {:.2f}% (tx: {:.2f} MB at {:.2f} MB/s)".format(
226
+ path,
227
+ 100 * (f_progress / fsize),
228
+ txsize / 1024 / 1024,
229
+ rate,
225
230
  )
226
231
  )
227
232
  sys.stdout.flush()
228
233
 
229
234
  def read_in_chunks():
230
- nonlocal f, txsize, t0, t, prev_t
231
- chunk = f.read(chunk_size)
235
+ nonlocal f, uncompressed_f, f_progress, txsize, t0, t, prev_t
236
+ chunk = uncompressed_f.read(chunk_size)
232
237
  while chunk:
233
238
  yield chunk
239
+ f_progress = f.tell()
234
240
  txsize += len(chunk)
235
241
  t = time.time()
236
242
  if not prev_t or (t - prev_t > 0.5): # Limit console writes
237
243
  report_load_stats(t - t0)
238
244
  prev_t = t
239
- chunk = f.read(chunk_size)
245
+ chunk = uncompressed_f.read(chunk_size)
240
246
  if txsize > 0:
241
247
  report_load_stats(t - t0)
242
248
  sys.stdout.write("\n")
yamcs/cli/utils.py CHANGED
@@ -4,9 +4,9 @@ import os
4
4
  import sys
5
5
  from configparser import ConfigParser
6
6
  from datetime import datetime, timedelta, timezone
7
+ from importlib.metadata import version
7
8
  from typing import Any, List
8
9
 
9
- import pkg_resources
10
10
  from dateutil import parser
11
11
  from yamcs.client import Credentials, parse_server_timestring, to_isostring
12
12
 
@@ -19,8 +19,7 @@ CREDENTIALS_FILE = os.path.join(CONFIG_DIR, "credentials")
19
19
 
20
20
 
21
21
  def get_user_agent():
22
- dist = pkg_resources.get_distribution("yamcs-cli")
23
- return "Yamcs CLI v" + dist.version
22
+ return "Yamcs CLI v" + version("yamcs-cli")
24
23
 
25
24
 
26
25
  def read_config():
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: yamcs-cli
3
- Version: 1.4.12
3
+ Version: 1.4.14
4
4
  Summary: Yamcs Command-Line Tools
5
5
  Home-page: https://github.com/yamcs/yamcs-cli
6
6
  Author: Space Applications Services
@@ -26,9 +26,22 @@ Description-Content-Type: text/markdown
26
26
  License-File: LICENSE
27
27
  Requires-Dist: argcomplete
28
28
  Requires-Dist: python-dateutil
29
- Requires-Dist: yamcs-client>=1.11.2
29
+ Requires-Dist: yamcs-client>=1.12.0
30
30
  Provides-Extra: kerberos
31
31
  Requires-Dist: yamcs-client-kerberos>=1.3.0; extra == "kerberos"
32
+ Dynamic: author
33
+ Dynamic: author-email
34
+ Dynamic: classifier
35
+ Dynamic: description
36
+ Dynamic: description-content-type
37
+ Dynamic: home-page
38
+ Dynamic: license
39
+ Dynamic: license-file
40
+ Dynamic: platform
41
+ Dynamic: provides-extra
42
+ Dynamic: requires-dist
43
+ Dynamic: requires-python
44
+ Dynamic: summary
32
45
 
33
46
  # Command-Line Interface
34
47
 
@@ -1,4 +1,4 @@
1
- yamcs/cli/__main__.py,sha256=JWPpQt2tBuZYnuABr7Sx940wwaj5-sWw3WIs34BlZQ0,4234
1
+ yamcs/cli/__main__.py,sha256=1CcXATPKWaKUx40MwXDK3RaoVtMyhMdKYKl_s0O_aOY,4228
2
2
  yamcs/cli/alarms.py,sha256=cHLwveHqvpnLHddktGA5LCyOt9FRljcwid9Q7TYd5FI,7126
3
3
  yamcs/cli/algorithms.py,sha256=Oqw0tiIv_mmK7smPYIdI00uUfM2KxHMbrySGi8Ywlcc,1622
4
4
  yamcs/cli/bash_completion.sh,sha256=sQOPhbykD68uMYkcWudqJNJKuSQh2Blzozt2kkawRo4,1032
@@ -13,8 +13,8 @@ yamcs/cli/instances.py,sha256=RBfHQUGZB4hU_MGdhPmZgzO_WkA2Sj54KpxT7BSyLeQ,2119
13
13
  yamcs/cli/links.py,sha256=RmdeYLqC1agtORso2T8MUcgp3f-zJKIfeb0UsupsXzc,3330
14
14
  yamcs/cli/login.py,sha256=VAIE--YGiCTwf8D79L3dHKKtTlmdSFcgkUcR37CwVzY,4969
15
15
  yamcs/cli/logout.py,sha256=XgIdxuAUHQ5VbPP6sZwN88cAvWQEm7GBPfvYj6vn9Rg,562
16
- yamcs/cli/packets.py,sha256=js-meTATi7a7IjVWC9nLiu56KdZNyDjZY9QBlRWfgD0,4645
17
- yamcs/cli/parameter_archive.py,sha256=rv1Evgi5iBsnE-AgSOtaQsFYiqekQDv1k3fVFiMK1iE,3007
16
+ yamcs/cli/packets.py,sha256=am8CZxJWpqsWtA3wqSBuD3xck8uv0dYkAYfdwnfimOM,4860
17
+ yamcs/cli/parameter_archive.py,sha256=KWdrtHXygGJNPhbAyHK5itxBAl1YqAwgQnkoDsd_5c4,3999
18
18
  yamcs/cli/parameters.py,sha256=ZDOfLly5gzKoUvfvg9vbDLMh_NYnh3mBi95n_sZCjSY,6012
19
19
  yamcs/cli/processors.py,sha256=9BJlQywmq6x_ea3tWT66dB2wBry9divqWhG3VWKM6Nw,1988
20
20
  yamcs/cli/rocksdb.py,sha256=28VjE9ldHUrGCxMeNNOn8FhnvdRJbiMlKjnjErgrl1k,1947
@@ -22,8 +22,8 @@ yamcs/cli/services.py,sha256=4sE7vOB977EmNfA4X9YJSyi3bSmhfqOj3cScGYGR4Lc,2171
22
22
  yamcs/cli/space_systems.py,sha256=hsjDzRNZLlUSlBuO-WJGyUXmIpoQYk0n84sgQ4y8wEA,2285
23
23
  yamcs/cli/storage.py,sha256=Ynqz5kIIqcPLTgfPJsnQ6dubOaqqE5_CmVOo0MzTnAQ,9771
24
24
  yamcs/cli/streams.py,sha256=RvB4OuqU0CiY_XAn356JiSlaO_AgIXEbHN1VRaHul64,2392
25
- yamcs/cli/tables.py,sha256=3Fc-31ViO3TT14SV0b9jhRPXa2NZsLcJMqr3tSYvHM4,8505
26
- yamcs/cli/utils.py,sha256=cQ1A_hEFvkcuF09UDVLm9UEzWMSmv8M_qi8xN16DSRs,7762
25
+ yamcs/cli/tables.py,sha256=7my4-oDD1270qO1s7zgKZ9vH92HtDMOlePbmFv5-2O0,8795
26
+ yamcs/cli/utils.py,sha256=MoefwXFjfYjYGHHrs_eHH23D1_pbvt8By7kBxb-RKaI,7733
27
27
  yamcs/cli/protobuf/activities_pb2.py,sha256=8V42hiw99laYl0pAMISd-B_PY6LAuXMkAeMOXwjyX88,2741
28
28
  yamcs/cli/protobuf/cmdhistory_pb2.py,sha256=8WK--s8OO9dCbDur86MraQXoMvJq-kU1ZMOHAJ4PvuI,4198
29
29
  yamcs/cli/protobuf/db_pb2.py,sha256=ObnWfpZZDoCCHQcBH7GRGRjXfnKgu8bKnw5fOZMo_e0,15789
@@ -31,9 +31,9 @@ yamcs/cli/protobuf/replication_pb2.py,sha256=0YzH8bVPi2DNmHcgxyv9m_XuhYnH83U0O6k
31
31
  yamcs/cli/protobuf/security_pb2.py,sha256=SbVHS7ghG_JDbZ_35p8GwVnV-3HuwNOGAWRVhFoWbPE,21569
32
32
  yamcs/cli/protobuf/tablespace_pb2.py,sha256=DLYPDKOgLm1xeZAT5F7WMLaGQJM_npeYfpZAFMSM6OU,37008
33
33
  yamcs/cli/protobuf/timeline_pb2.py,sha256=JUl7sGOYMS8IP6h0hCOCrQz8BaBtvxjf6lY7cpDYcfg,5004
34
- yamcs_cli-1.4.12.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
35
- yamcs_cli-1.4.12.dist-info/METADATA,sha256=GDAyRQHDISQK3ug3tzlVW_QbyLyDCKa4AIzB9RAvXH0,1417
36
- yamcs_cli-1.4.12.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
37
- yamcs_cli-1.4.12.dist-info/entry_points.txt,sha256=M6Juk3MbdDMR1v3htR2aHEebitGHW-E3ujHmYQLwEas,50
38
- yamcs_cli-1.4.12.dist-info/top_level.txt,sha256=EsFTpWxnHBl6f_5Wf-CrENGPSoY7xP4T-JpgBMwsk8Q,6
39
- yamcs_cli-1.4.12.dist-info/RECORD,,
34
+ yamcs_cli-1.4.14.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
35
+ yamcs_cli-1.4.14.dist-info/METADATA,sha256=vnhGaxR6JHchZIpkHXQvFJeZcV73GVauI492xrSZsLY,1695
36
+ yamcs_cli-1.4.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ yamcs_cli-1.4.14.dist-info/entry_points.txt,sha256=M6Juk3MbdDMR1v3htR2aHEebitGHW-E3ujHmYQLwEas,50
38
+ yamcs_cli-1.4.14.dist-info/top_level.txt,sha256=EsFTpWxnHBl6f_5Wf-CrENGPSoY7xP4T-JpgBMwsk8Q,6
39
+ yamcs_cli-1.4.14.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.7.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5