omnata-plugin-runtime 0.6.7a176__py3-none-any.whl → 0.6.9a178__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ else:
15
15
  # Python 3.8 and below
16
16
  from typing_extensions import Annotated
17
17
 
18
-
18
+ import zipfile
19
19
  import datetime
20
20
  import http
21
21
  import json
@@ -1296,7 +1296,7 @@ class InboundSyncRequest(SyncRequest):
1296
1296
  ]
1297
1297
  for datetime_property in datetime_properties:
1298
1298
  try:
1299
- if datetime_property in data:
1299
+ if datetime_property in data and data[datetime_property] is not None:
1300
1300
  data[datetime_property] = parse(
1301
1301
  data[datetime_property]
1302
1302
  ).isoformat()
@@ -2552,4 +2552,23 @@ def find_udf_functions(path:str = '.') -> List[UDFDefinition]:
2552
2552
  description='The connection object, obtained from calling PLUGIN.PLUGIN_CONNECTION.')] + udf_obj.params
2553
2553
  matching_classes.append(udf_obj)
2554
2554
 
2555
- return matching_classes
2555
+ return matching_classes
2556
+
2557
+ def get_static_file_contents(relative_path:str) -> bytes:
2558
+ """
2559
+ Retrieve file packaged with this plugin, by extracting it from the zip file.
2560
+ The relative path will be relative to the root of the src folder of the plugin.
2561
+ """
2562
+ # this file will be inside the zip file, so we can find it by looking at the path of this file
2563
+ full_path_to_this = os.path.abspath(__file__)
2564
+ split_position = full_path_to_this.find('app.zip')
2565
+ if split_position == -1:
2566
+ with open(relative_path, 'rb') as f:
2567
+ return f.read()
2568
+ # Add the length of 'app.zip' to split just after it
2569
+ split_position += len('app.zip')
2570
+
2571
+ path_to_zip = full_path_to_this[:split_position]
2572
+ with zipfile.ZipFile(path_to_zip, 'r') as z:
2573
+ with z.open(relative_path, 'rb') as f:
2574
+ return f.read()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: omnata-plugin-runtime
3
- Version: 0.6.7a176
3
+ Version: 0.6.9a178
4
4
  Summary: Classes and common runtime components for building and running Omnata Plugins
5
5
  Author: James Weakley
6
6
  Author-email: james.weakley@omnata.com
@@ -3,10 +3,10 @@ omnata_plugin_runtime/api.py,sha256=FxzTqri4no8ClkOm7vZADG8aD47jcGBCTTQDEORmOJM,
3
3
  omnata_plugin_runtime/configuration.py,sha256=TI6GaVFhewVawBCaYN34GujY57qEP6q2nik4YpSEk5s,38100
4
4
  omnata_plugin_runtime/forms.py,sha256=GzSPEwcijsoPCXEO1mHiE8ylvX_KSE5TkhwqkymA2Ss,19755
5
5
  omnata_plugin_runtime/logging.py,sha256=bn7eKoNWvtuyTk7RTwBS9UARMtqkiICtgMtzq3KA2V0,3272
6
- omnata_plugin_runtime/omnata_plugin.py,sha256=ndxvvEAR6uzT2EmsZVXC86GJE8wFCxDC9bjtax1J20s,128812
6
+ omnata_plugin_runtime/omnata_plugin.py,sha256=iv7CYDxLCgIp6DgLnSx5iPXnKSEFaQyWIFxH9LYLNos,129688
7
7
  omnata_plugin_runtime/plugin_entrypoints.py,sha256=cQRBzNQiKFO088FTzDAyhxp_meJxxuIy1lX8uA0o7FI,28620
8
8
  omnata_plugin_runtime/rate_limiting.py,sha256=JukA0l7x7Klqz2b54mR-poP7NRxpUHgWSGp6h0B8u6Q,25612
9
- omnata_plugin_runtime-0.6.7a176.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
10
- omnata_plugin_runtime-0.6.7a176.dist-info/METADATA,sha256=7oLDGRj0_0MVVteeeiVCZdapEGjpLwCbOlj7QWGoDUI,1985
11
- omnata_plugin_runtime-0.6.7a176.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
12
- omnata_plugin_runtime-0.6.7a176.dist-info/RECORD,,
9
+ omnata_plugin_runtime-0.6.9a178.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
10
+ omnata_plugin_runtime-0.6.9a178.dist-info/METADATA,sha256=BXFUDAiFroMRtSLYhmBMMmfFHA99h8wmwSBHYnr29cw,1985
11
+ omnata_plugin_runtime-0.6.9a178.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
12
+ omnata_plugin_runtime-0.6.9a178.dist-info/RECORD,,