eva-shell 0.2.16__tar.gz → 0.2.18__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.1
2
2
  Name: eva-shell
3
- Version: 0.2.16
3
+ Version: 0.2.18
4
4
  Summary: EVA ICS v4 shell
5
5
  Home-page: https://github.com/eva-ics/eva4
6
6
  Author: Bohemia Automation / Altertech
@@ -1,3 +1,3 @@
1
- __version__ = '0.2.16'
1
+ __version__ = '0.2.18'
2
2
 
3
3
  DEFAULT_REPOSITORY_URL = 'https://pub.bma.ai/eva4'
@@ -262,7 +262,7 @@ def append_svc_cli(root_sp):
262
262
  p.add_argument('-f',
263
263
  '--file',
264
264
  metavar='FILE',
265
- help='read call params payload form the file'
265
+ help='read call params payload form the file ("-" for stdin)'
266
266
  ).completer = ComplDeployFile()
267
267
  p.add_argument('method', metavar='METHOD').completer = ComplSvcRpcMethod()
268
268
  p.add_argument('params',
@@ -618,6 +618,7 @@ def append_item_cli(root_sp):
618
618
 
619
619
  p = sp.add_parser('export', help='export item(s) to a deployment file')
620
620
  p.add_argument('i', metavar='MASK').completer = ComplOID()
621
+ p.add_argument('-y', '--full', help='include item states', action='store_true')
621
622
  p.add_argument('-o', '--output', metavar='FILE',
622
623
  help='output file').completer = ComplDeployFile()
623
624
 
@@ -1387,7 +1388,8 @@ def init_ap():
1387
1388
 
1388
1389
  sp.add_parser('save', help='save scheduled states (if instant-save is off)')
1389
1390
  append_svc_cli(sp)
1390
- sp.add_parser('test', help='core test/info')
1391
+ p = sp.add_parser('test', help='core test/info')
1392
+ p.add_argument('--wait-active', help='wait for the core to become active', action='store_true')
1391
1393
 
1392
1394
  p = sp.add_parser('dump', help='dump node info')
1393
1395
  p.add_argument('-s',
@@ -52,8 +52,15 @@ class CLI:
52
52
  args += f' --dest "{kwargs["dest"]}"'
53
53
  exec_cmd('venvmgr', args, search_in='sbin', search_system=False)
54
54
 
55
- def test(self):
56
- data = call_rpc('test')
55
+ def test(self, wait_active=False):
56
+ op_start = time.perf_counter()
57
+ while True:
58
+ if op_start + current_command.timeout < time.perf_counter():
59
+ raise TimeoutError
60
+ else:
61
+ data = call_rpc('test')
62
+ if not wait_active or data.get('active'):
63
+ break
57
64
  print_result(data, need_header=False, name_value=True)
58
65
 
59
66
  def dump(self, s=False):
@@ -945,13 +952,18 @@ class CLI:
945
952
  )
946
953
  ok()
947
954
 
948
- def item_export(self, i, output=None):
955
+ def item_export(self, i, full=False, output=None):
949
956
  c = 0
950
- configs = []
957
+ configs = dict()
951
958
  for item in call_rpc('item.list', dict(i=i, node='.local')):
952
959
  c += 1
953
- configs.append(call_rpc('item.get_config', dict(i=item['oid'])))
954
- result = dict(items=configs)
960
+ configs[item['oid']] = call_rpc('item.get_config', dict(i=item['oid']))
961
+ if full:
962
+ for state in call_rpc('item.state', dict(i=list(configs))):
963
+ oid = state['oid']
964
+ configs[oid]['status'] = state['status']
965
+ configs[oid]['value'] = state['value']
966
+ result = dict(items=sorted([v for _, v in configs.items()], key= lambda k: k['oid']))
955
967
  if current_command.json:
956
968
  print_result(result)
957
969
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eva-shell
3
- Version: 0.2.16
3
+ Version: 0.2.18
4
4
  Summary: EVA ICS v4 shell
5
5
  Home-page: https://github.com/eva-ics/eva4
6
6
  Author: Bohemia Automation / Altertech
@@ -1,4 +1,4 @@
1
- __version__ = '0.2.16'
1
+ __version__ = '0.2.18'
2
2
 
3
3
  import setuptools
4
4
 
File without changes
File without changes
File without changes
File without changes