polyapi-python 0.2.7.dev0__py3-none-any.whl → 0.2.7.dev2__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.
- polyapi/cli.py +5 -2
- polyapi/function_cli.py +9 -1
- {polyapi_python-0.2.7.dev0.dist-info → polyapi_python-0.2.7.dev2.dist-info}/METADATA +1 -1
- {polyapi_python-0.2.7.dev0.dist-info → polyapi_python-0.2.7.dev2.dist-info}/RECORD +7 -7
- {polyapi_python-0.2.7.dev0.dist-info → polyapi_python-0.2.7.dev2.dist-info}/WHEEL +1 -1
- {polyapi_python-0.2.7.dev0.dist-info → polyapi_python-0.2.7.dev2.dist-info}/LICENSE +0 -0
- {polyapi_python-0.2.7.dev0.dist-info → polyapi_python-0.2.7.dev2.dist-info}/top_level.txt +0 -0
polyapi/cli.py
CHANGED
|
@@ -4,7 +4,7 @@ from polyapi.utils import print_green
|
|
|
4
4
|
|
|
5
5
|
from .config import clear_config, set_api_key_and_url
|
|
6
6
|
from .generate import generate, clear
|
|
7
|
-
from .function_cli import function_add_or_update
|
|
7
|
+
from .function_cli import function_add_or_update, function_execute
|
|
8
8
|
from .rendered_spec import get_and_update_rendered_spec
|
|
9
9
|
|
|
10
10
|
|
|
@@ -56,4 +56,7 @@ def execute_from_cli() -> None:
|
|
|
56
56
|
print("Clearing the generated library...")
|
|
57
57
|
clear()
|
|
58
58
|
elif command == "function":
|
|
59
|
-
|
|
59
|
+
if args.subcommands[0] == "execute":
|
|
60
|
+
print(function_execute(args.context, args.subcommands))
|
|
61
|
+
else:
|
|
62
|
+
function_add_or_update(args.context, args.description, args.client, args.server, args.logs, args.subcommands, not args.skip_generate)
|
polyapi/function_cli.py
CHANGED
|
@@ -3,7 +3,7 @@ import argparse
|
|
|
3
3
|
import json
|
|
4
4
|
import types
|
|
5
5
|
import sys
|
|
6
|
-
from typing import Dict, List, Mapping, Optional, Tuple
|
|
6
|
+
from typing import Any, Dict, List, Mapping, Optional, Tuple
|
|
7
7
|
from typing import _TypedDictMeta as BaseTypedDict # type: ignore
|
|
8
8
|
from typing_extensions import _TypedDictMeta # type: ignore
|
|
9
9
|
import requests
|
|
@@ -279,3 +279,11 @@ def function_add_or_update(
|
|
|
279
279
|
print(resp.status_code)
|
|
280
280
|
print(resp.content)
|
|
281
281
|
sys.exit(1)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
def function_execute(context: str, subcommands: List) -> Any:
|
|
285
|
+
assert subcommands[0] == "execute"
|
|
286
|
+
context_code = importlib.import_module(f"polyapi.poly.{context}")
|
|
287
|
+
print(f"Executing poly.{context}.{subcommands[1]}... ")
|
|
288
|
+
fn = getattr(context_code, subcommands[1])
|
|
289
|
+
return fn(*subcommands[2:])
|
|
@@ -2,14 +2,14 @@ polyapi/__init__.py,sha256=5iujRodfgRyLxT-zY0L3xax3rKRvfSt4NZlZYKOz03w,608
|
|
|
2
2
|
polyapi/__main__.py,sha256=V4zhAh_YGxno5f_KSrlkELxcuDh9bR3WSd0n-2r-qQQ,93
|
|
3
3
|
polyapi/api.py,sha256=bE651P47RuhqNYkVyvTH_pA44JypRZED_2M5UG_qzDI,1863
|
|
4
4
|
polyapi/auth.py,sha256=zrIGatjba5GwUTNjKj1GHQWTEDP9B-HrSzCKbLFoqvc,5336
|
|
5
|
-
polyapi/cli.py,sha256=
|
|
5
|
+
polyapi/cli.py,sha256=1ZeaK1A0wZM91YLJrYmvSR2wwHRkT7w1p7q9Y0KZu9c,2785
|
|
6
6
|
polyapi/client.py,sha256=w15XOABkwdL4V4r2iWY_nypzLjvoKVuux8jUKbA16pQ,1329
|
|
7
7
|
polyapi/config.py,sha256=S8TU10upy5OW1_vX-CqQTJD-ZOB6329aMjiUCmukfUI,2292
|
|
8
8
|
polyapi/constants.py,sha256=sc-FnS0SngBLvSu1ZWMs0UCf9EYD1u1Yhfr-sZXGLns,607
|
|
9
9
|
polyapi/error_handler.py,sha256=I_e0iz6VM23FLVQWJljxs2NGcl_OODbi43OcbnqBlp8,2398
|
|
10
10
|
polyapi/exceptions.py,sha256=Zh7i7eCUhDuXEdUYjatkLFTeZkrx1BJ1P5ePgbJ9eIY,89
|
|
11
11
|
polyapi/execute.py,sha256=kXnvlNQ7nz9cRlV2_5gXH09UCmyiDP5zi3wiAw0uDuk,1943
|
|
12
|
-
polyapi/function_cli.py,sha256=
|
|
12
|
+
polyapi/function_cli.py,sha256=GXRSThnt3oQqXWU8K76E8ry15DZOjsHUjjUZ9k5MGGE,9509
|
|
13
13
|
polyapi/generate.py,sha256=LN2Z6fE-HfpMsXlkJfOl8bqZdR3fUythE_ZsAe15tmk,8012
|
|
14
14
|
polyapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
polyapi/rendered_spec.py,sha256=uaNzBhP4cX7iGfKwzZv0dxMagWzsGeDr0cQYx_AyIhQ,2153
|
|
@@ -19,8 +19,8 @@ polyapi/typedefs.py,sha256=mRqwd2LKofxNn_VSKxBzixni2j-tai8mfTQ0Wi2aLNM,1487
|
|
|
19
19
|
polyapi/utils.py,sha256=JtL_v0PVkJBlTeRu0gIV5IDScqoiggS8m-VcS4HN22c,6890
|
|
20
20
|
polyapi/variables.py,sha256=d36-trnfTL_8m2NkorMiImb4O3UrJbiFV38CHxV5i0A,4200
|
|
21
21
|
polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
|
|
22
|
-
polyapi_python-0.2.7.
|
|
23
|
-
polyapi_python-0.2.7.
|
|
24
|
-
polyapi_python-0.2.7.
|
|
25
|
-
polyapi_python-0.2.7.
|
|
26
|
-
polyapi_python-0.2.7.
|
|
22
|
+
polyapi_python-0.2.7.dev2.dist-info/LICENSE,sha256=Hi0kDr56Dsy0uYIwNt4r9G7tI8x8miXRTlyvbeplCP8,1068
|
|
23
|
+
polyapi_python-0.2.7.dev2.dist-info/METADATA,sha256=WXWOCAB8Wpa7lMzSoE9-1LHVP1BRdYC17uQFgxV2O8Y,4867
|
|
24
|
+
polyapi_python-0.2.7.dev2.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
|
|
25
|
+
polyapi_python-0.2.7.dev2.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
|
|
26
|
+
polyapi_python-0.2.7.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|