bosdyn-mission 5.0.0__py3-none-any.whl → 5.0.1__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.
- bosdyn/mission/util.py +39 -43
- {bosdyn_mission-5.0.0.dist-info → bosdyn_mission-5.0.1.dist-info}/METADATA +3 -3
- {bosdyn_mission-5.0.0.dist-info → bosdyn_mission-5.0.1.dist-info}/RECORD +5 -5
- {bosdyn_mission-5.0.0.dist-info → bosdyn_mission-5.0.1.dist-info}/WHEEL +0 -0
- {bosdyn_mission-5.0.0.dist-info → bosdyn_mission-5.0.1.dist-info}/top_level.txt +0 -0
bosdyn/mission/util.py
CHANGED
|
@@ -185,54 +185,50 @@ def proto_from_tuple(tup, pack_nodes=True):
|
|
|
185
185
|
def python_var_to_value(var) -> util_pb2.ConstantValue:
|
|
186
186
|
"""Returns a ConstantValue with the appropriate oneof set."""
|
|
187
187
|
value = util_pb2.ConstantValue()
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
else:
|
|
208
|
-
raise Error('Invalid type "{}"'.format(type(var)))
|
|
188
|
+
if isinstance(var, bool):
|
|
189
|
+
value.bool_value = var
|
|
190
|
+
elif isinstance(var, int):
|
|
191
|
+
value.int_value = var
|
|
192
|
+
elif isinstance(var, float):
|
|
193
|
+
value.float_value = var
|
|
194
|
+
elif isinstance(var, str):
|
|
195
|
+
value.string_value = var
|
|
196
|
+
elif isinstance(var, util_pb2.ConstantValue):
|
|
197
|
+
value.CopyFrom(var)
|
|
198
|
+
elif isinstance(var, google.protobuf.message.Message):
|
|
199
|
+
value.msg_value.Pack(var)
|
|
200
|
+
elif isinstance(var, collections.abc.Mapping):
|
|
201
|
+
for key, val in var.items():
|
|
202
|
+
value.dict_value.values[key].CopyFrom(python_var_to_value(val))
|
|
203
|
+
elif isinstance(var, collections.abc.Iterable):
|
|
204
|
+
value.list_value.values.extend([python_var_to_value(v) for v in var])
|
|
205
|
+
else:
|
|
206
|
+
raise Error('Invalid type "{}"'.format(type(var)))
|
|
209
207
|
return value
|
|
210
208
|
|
|
211
209
|
|
|
212
210
|
def python_type_to_pb_type(var) -> util_pb2.VariableDeclaration.Type.ValueType:
|
|
213
211
|
"""Returns the protobuf-schema variable type that corresponds to the given variable."""
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
elif isinstance(var, collections.abc.Iterable):
|
|
235
|
-
return util_pb2.VariableDeclaration.TYPE_LIST
|
|
212
|
+
if isinstance(var, bool):
|
|
213
|
+
return util_pb2.VariableDeclaration.TYPE_BOOL
|
|
214
|
+
elif isinstance(var, int):
|
|
215
|
+
return util_pb2.VariableDeclaration.TYPE_INT
|
|
216
|
+
elif isinstance(var, float):
|
|
217
|
+
return util_pb2.VariableDeclaration.TYPE_FLOAT
|
|
218
|
+
elif isinstance(var, str):
|
|
219
|
+
return util_pb2.VariableDeclaration.TYPE_STRING
|
|
220
|
+
# Special case for List and Dict value to allow using this function
|
|
221
|
+
# with ConstantValue.WhichOneof() to return the correct pb type.
|
|
222
|
+
elif isinstance(var, util_pb2.ConstantValue.ListValue):
|
|
223
|
+
return util_pb2.VariableDeclaration.TYPE_LIST
|
|
224
|
+
elif isinstance(var, util_pb2.ConstantValue.DictValue):
|
|
225
|
+
return util_pb2.VariableDeclaration.TYPE_DICT
|
|
226
|
+
elif isinstance(var, google.protobuf.message.Message):
|
|
227
|
+
return util_pb2.VariableDeclaration.TYPE_MESSAGE
|
|
228
|
+
elif isinstance(var, collections.abc.Mapping):
|
|
229
|
+
return util_pb2.VariableDeclaration.TYPE_DICT
|
|
230
|
+
elif isinstance(var, collections.abc.Iterable):
|
|
231
|
+
return util_pb2.VariableDeclaration.TYPE_LIST
|
|
236
232
|
raise InvalidConversion(var, util_pb2.VariableDeclaration.Type.DESCRIPTOR.full_name)
|
|
237
233
|
|
|
238
234
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: bosdyn-mission
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.1
|
|
4
4
|
Summary: Boston Dynamics mission code
|
|
5
5
|
Home-page: https://dev.bostondynamics.com/
|
|
6
6
|
Author: Boston Dynamics
|
|
@@ -15,8 +15,8 @@ Classifier: License :: Other/Proprietary License
|
|
|
15
15
|
Classifier: Operating System :: OS Independent
|
|
16
16
|
Requires-Python: >=3.7
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
|
-
Requires-Dist: bosdyn-client (==5.0.
|
|
19
|
-
Requires-Dist: bosdyn-api (==5.0.
|
|
18
|
+
Requires-Dist: bosdyn-client (==5.0.1)
|
|
19
|
+
Requires-Dist: bosdyn-api (==5.0.1)
|
|
20
20
|
|
|
21
21
|
<!--
|
|
22
22
|
Copyright (c) 2023 Boston Dynamics, Inc. All rights reserved.
|
|
@@ -5,8 +5,8 @@ bosdyn/mission/constants.py,sha256=oSsl0XR1-fNzHASGNqs541YEO8qi64eewvbY9ICKaxE,4
|
|
|
5
5
|
bosdyn/mission/exceptions.py,sha256=UqGT0XK3zA6Bgwo_7KNC44yi_MvW9h3c8_pHKML8ELQ,3941
|
|
6
6
|
bosdyn/mission/remote_client.py,sha256=quGWyqLzpASgrR6MlnEPoRFCmnTMSBZ6tmr-Wyy9YW0,12190
|
|
7
7
|
bosdyn/mission/server_util.py,sha256=xd9D5VwP6mjbxUcUGCV4gN2AvsmRpL9wyvMpKR6Bmxk,1505
|
|
8
|
-
bosdyn/mission/util.py,sha256=
|
|
9
|
-
bosdyn_mission-5.0.
|
|
10
|
-
bosdyn_mission-5.0.
|
|
11
|
-
bosdyn_mission-5.0.
|
|
12
|
-
bosdyn_mission-5.0.
|
|
8
|
+
bosdyn/mission/util.py,sha256=n7ODM0E-4I25BHutzV6ThrgmZHpkWB5YdXDYfexmxcc,19489
|
|
9
|
+
bosdyn_mission-5.0.1.dist-info/METADATA,sha256=ynX9UBtCLe-Mkd48quGZzW2IoffekWC2NGt5qB4HeYE,1733
|
|
10
|
+
bosdyn_mission-5.0.1.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
|
|
11
|
+
bosdyn_mission-5.0.1.dist-info/top_level.txt,sha256=an2OWgx1ej2jFjmBjPWNQ68ZglvUfKhmXWW-WhTtDmA,7
|
|
12
|
+
bosdyn_mission-5.0.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|