remotivelabs-cli 0.0.17__py3-none-any.whl → 0.0.19__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.
cli/broker/scripting.py CHANGED
@@ -51,6 +51,18 @@ def new_script(
51
51
 
52
52
  local_signals = ",".join(list(map(to_local_signal, signals_to_subscribe_to)))
53
53
 
54
+ def to_subscribe_pattern(sig_name: tuple[str, str]):
55
+ t = Template(
56
+ """
57
+ if (signals["$sig_name"] ~= nil) then
58
+ return return_value_or_bytes(signals["$sig_name"])
59
+ end
60
+ """
61
+ )
62
+ return t.substitute(sig_name=sig_name[1])
63
+
64
+ subscribe_pattern = "".join(list(map(to_subscribe_pattern, signals_to_subscribe_to)))
65
+
54
66
  template = Template(
55
67
  """
56
68
  --
@@ -70,33 +82,26 @@ function output_signal()
70
82
  return "$output_signal"
71
83
  end
72
84
 
73
- local local_frequency_hz = 0
74
-
75
85
  -- Required, declare what frequency you like to get "timer" invoked. 0 means no calls to "timer".
76
86
  function timer_frequency_hz()
77
- return local_frequency_hz
87
+ return 0
78
88
  end
79
89
 
80
- -- Invoked with the frequecy returned by "timer_frequency_hz".
81
- -- @param system_timestamp_us: system time stamp.
90
+ -- Invoked with the frequency returned by "timer_frequency_hz".
91
+ -- @param system_timestamp_us: system time stamp
82
92
  function timer(system_timestamp_us)
83
93
  return return_value_or_bytes("your value")
84
94
  end
85
95
 
86
-
87
96
  -- Invoked when ANY signal declared in "local_signals" arrive
88
97
  -- @param signals_timestamp_us: signal time stamp
89
98
  -- @param system_timestamp_us
90
99
  -- @param signals: array of signals containing all or a subset of signals declared in "local_signals". Make sure to nil check before use.
91
100
  function signals(signals, namespace, signals_timestamp_us, system_timestamp_us)
92
-
93
101
  -- TODO - replace this code with what you want todo
94
102
 
95
- if signals["$signle_input_signal"] == 0 then
96
- return return_value_or_bytes(0)
97
- else
98
- return return_value_or_bytes(signals["$signle_input_signal"] * 2)
99
- end
103
+ $subscribe_pattern
104
+ return return_nothing()
100
105
  end
101
106
 
102
107
  -- helper return function, make sure to use return_value_or_bytes or return_nothing.
@@ -104,12 +109,18 @@ function return_value_or_bytes(value_or_bytes)
104
109
  return value_or_bytes
105
110
  end
106
111
 
112
+ -- helper return function, make sure to use return_value_or_bytes or return_nothing.
113
+ function return_nothing()
114
+ return
115
+ end
116
+
107
117
  """
108
118
  )
109
119
 
110
120
  script = template.substitute(
111
121
  local_signals=local_signals,
112
- signle_input_signal=signals_to_subscribe_to[0][1], # Take one signal and use signal name in tuple
122
+ # signle_input_signal=signals_to_subscribe_to[0][1], # Take one signal and use signal name in tuple
123
+ subscribe_pattern=subscribe_pattern,
113
124
  output_signal=output_signal,
114
125
  )
115
126
 
cli/cloud/recordings.py CHANGED
@@ -228,9 +228,7 @@ def upload(
228
228
  else:
229
229
  r = rest.handle_post(f"/api/project/{project}/files/recording/{filename}", return_response=True)
230
230
 
231
- response = rest.upload_file_with_signed_url(
232
- path=path.name, url=r.text, upload_headers={"Content-Type": "application/x-www-form-urlencoded"}
233
- )
231
+ response = rest.upload_file_with_signed_url(path=path, url=r.text, upload_headers={"Content-Type": "application/x-www-form-urlencoded"})
234
232
 
235
233
  if 200 <= response.status_code < 300:
236
234
  print(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: remotivelabs-cli
3
- Version: 0.0.17
3
+ Version: 0.0.19
4
4
  Summary: CLI for operating RemotiveCloud and RemotiveBroker
5
5
  Author: Johan Rask
6
6
  Author-email: johan.rask@remotivelabs.com
@@ -9,7 +9,7 @@ cli/broker/license_flows.py,sha256=AaKvZgy_hkP5Mv-1dXtQxQxXGidpvuVDVY3jP2AX0t0,7
9
9
  cli/broker/licenses.py,sha256=iJeF6aWKUPhXb24t0pyufFRmMGNCFo-G_ZUz1rstqqs,3957
10
10
  cli/broker/playback.py,sha256=oOfC8Jn4Ib-nc9T6ob_uNXZSeCWfft7MrMQPafH4U2I,4846
11
11
  cli/broker/record.py,sha256=gEvo3myHbIl6UyXzhJE741NiwRrFf7doBg6HXzzp5z0,1382
12
- cli/broker/scripting.py,sha256=sLDtuktWsVk0fJ3RW4kYyh-_YAVJP3VM0xFIQR499Oo,3392
12
+ cli/broker/scripting.py,sha256=Nb6C8JjfuQXuvd_L8CtlTHEc5iTBRwI4RXMQdf_gWYg,3752
13
13
  cli/broker/signals.py,sha256=py_qOwTP5ongpOVLKznMfVPw68iB--1eIvnRdOLND7k,6556
14
14
  cli/cloud/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
15
15
  cli/cloud/auth.py,sha256=xi47cQWjs6q7Kje4XUbTqEk_BgG3NJ1gMOYPU-_4tgw,3470
@@ -18,7 +18,7 @@ cli/cloud/brokers.py,sha256=wa3uMg91IZdrP0tMpTdO9cBIkZHtMHxQ-zEXwFiye_I,4127
18
18
  cli/cloud/cloud_cli.py,sha256=nRRXFF_IgUMayerxS-h7oqsNe6tt34Q5VeThq8gatEg,1443
19
19
  cli/cloud/configs.py,sha256=2p1mCHf5BwYNtwbY0Cbed5t6-79WHGKWU4Fv6LuJ21o,4069
20
20
  cli/cloud/projects.py,sha256=-uqltAOficwprOKaPd2R0Itm4sqTz3VJNs9Sc8jtO5k,1369
21
- cli/cloud/recordings.py,sha256=xbdqUYVmKyChV24cASK3zNPkmCPwIUmX9H5LsG98zfI,20820
21
+ cli/cloud/recordings.py,sha256=aBQeZW569cBcf_qLZA5StmgNnnSKYaaunn91SXnJVQM,20801
22
22
  cli/cloud/recordings_playback.py,sha256=OXRvoE7Zc_jQrofpqjbWYKZ6pfhJVHBe0bQ9GEfv64Q,10879
23
23
  cli/cloud/rest_helper.py,sha256=WK5We-vWg0GwnTq37OyKVuQTc58RFkPuA0kq5wjDtCk,7769
24
24
  cli/cloud/sample_recordings.py,sha256=g1X6JTxvzWInSP9R1BJsDmL4WqvpEKqjdJR_xT4bo1U,639
@@ -35,8 +35,8 @@ cli/tools/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
35
35
  cli/tools/can/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
36
36
  cli/tools/can/can.py,sha256=kSd1c-nxxXyeKkm19oDILiDBZsKOcpjsUT0T3xox5Qs,2172
37
37
  cli/tools/tools.py,sha256=LwQdWMcJ19pCyKUsVfSB2B3R6ui61NxxFWP0Nrnd5Jk,198
38
- remotivelabs_cli-0.0.17.dist-info/LICENSE,sha256=qDPP_yfuv1fF-u7EfexN-cN3M8aFgGVndGhGLovLKz0,608
39
- remotivelabs_cli-0.0.17.dist-info/METADATA,sha256=UXlSn4wNyCgJU9YgNVYEOUdqskNhdvkd5uLRtY_-eqk,1224
40
- remotivelabs_cli-0.0.17.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
41
- remotivelabs_cli-0.0.17.dist-info/entry_points.txt,sha256=lvDhPgagLqW_KTnLPCwKSqfYlEp-1uYVosRiPjsVj10,45
42
- remotivelabs_cli-0.0.17.dist-info/RECORD,,
38
+ remotivelabs_cli-0.0.19.dist-info/LICENSE,sha256=qDPP_yfuv1fF-u7EfexN-cN3M8aFgGVndGhGLovLKz0,608
39
+ remotivelabs_cli-0.0.19.dist-info/METADATA,sha256=-FqhillN-pyGexvBbcbhO6CNFCIhreMRgl3Py2OxMV0,1224
40
+ remotivelabs_cli-0.0.19.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
41
+ remotivelabs_cli-0.0.19.dist-info/entry_points.txt,sha256=lvDhPgagLqW_KTnLPCwKSqfYlEp-1uYVosRiPjsVj10,45
42
+ remotivelabs_cli-0.0.19.dist-info/RECORD,,