yamcs-cli 1.4.12__py3-none-any.whl → 1.4.13__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.
@@ -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")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yamcs-cli
3
- Version: 1.4.12
3
+ Version: 1.4.13
4
4
  Summary: Yamcs Command-Line Tools
5
5
  Home-page: https://github.com/yamcs/yamcs-cli
6
6
  Author: Space Applications Services
@@ -26,7 +26,7 @@ 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.11.3
30
30
  Provides-Extra: kerberos
31
31
  Requires-Dist: yamcs-client-kerberos>=1.3.0; extra == "kerberos"
32
32
 
@@ -14,7 +14,7 @@ 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
16
  yamcs/cli/packets.py,sha256=js-meTATi7a7IjVWC9nLiu56KdZNyDjZY9QBlRWfgD0,4645
17
- yamcs/cli/parameter_archive.py,sha256=rv1Evgi5iBsnE-AgSOtaQsFYiqekQDv1k3fVFiMK1iE,3007
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,7 +22,7 @@ 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
25
+ yamcs/cli/tables.py,sha256=7my4-oDD1270qO1s7zgKZ9vH92HtDMOlePbmFv5-2O0,8795
26
26
  yamcs/cli/utils.py,sha256=cQ1A_hEFvkcuF09UDVLm9UEzWMSmv8M_qi8xN16DSRs,7762
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
@@ -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.13.dist-info/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
35
+ yamcs_cli-1.4.13.dist-info/METADATA,sha256=mtR4OjkYFKNfY1rB_Pp44IXi9VchHgfcqkGXqbEUS3w,1417
36
+ yamcs_cli-1.4.13.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
37
+ yamcs_cli-1.4.13.dist-info/entry_points.txt,sha256=M6Juk3MbdDMR1v3htR2aHEebitGHW-E3ujHmYQLwEas,50
38
+ yamcs_cli-1.4.13.dist-info/top_level.txt,sha256=EsFTpWxnHBl6f_5Wf-CrENGPSoY7xP4T-JpgBMwsk8Q,6
39
+ yamcs_cli-1.4.13.dist-info/RECORD,,