omnata-plugin-runtime 0.6.8a177__py3-none-any.whl → 0.6.9__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- omnata_plugin_runtime/omnata_plugin.py +21 -2
- {omnata_plugin_runtime-0.6.8a177.dist-info → omnata_plugin_runtime-0.6.9.dist-info}/METADATA +1 -1
- {omnata_plugin_runtime-0.6.8a177.dist-info → omnata_plugin_runtime-0.6.9.dist-info}/RECORD +5 -5
- {omnata_plugin_runtime-0.6.8a177.dist-info → omnata_plugin_runtime-0.6.9.dist-info}/LICENSE +0 -0
- {omnata_plugin_runtime-0.6.8a177.dist-info → omnata_plugin_runtime-0.6.9.dist-info}/WHEEL +0 -0
@@ -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
|
@@ -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, 'r') as f:
|
2574
|
+
return f.read()
|
@@ -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=
|
6
|
+
omnata_plugin_runtime/omnata_plugin.py,sha256=qbcpY2EGFE55GVPuJCWWVVPV2aSf_Gs0AVio5A0kZmc,129687
|
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.
|
10
|
-
omnata_plugin_runtime-0.6.
|
11
|
-
omnata_plugin_runtime-0.6.
|
12
|
-
omnata_plugin_runtime-0.6.
|
9
|
+
omnata_plugin_runtime-0.6.9.dist-info/LICENSE,sha256=rGaMQG3R3F5-JGDp_-rlMKpDIkg5n0SI4kctTk8eZSI,56
|
10
|
+
omnata_plugin_runtime-0.6.9.dist-info/METADATA,sha256=BFOW2Q_fi5skbh3hORNaqleoQQEsbGfSPdD3khjc8ZA,1981
|
11
|
+
omnata_plugin_runtime-0.6.9.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
12
|
+
omnata_plugin_runtime-0.6.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|