polyapi-python 0.3.10.dev6__py3-none-any.whl → 0.3.11.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 CHANGED
@@ -47,8 +47,11 @@ def execute_from_cli():
47
47
  setup_parser.add_argument("url", nargs="?", help="URL for the Poly API")
48
48
 
49
49
  def setup(args):
50
- if args.api_key and args.url:
51
- set_api_key_and_url(args.url, args.api_key)
50
+ api_key = args.api_key or os.getenv("POLY_API_KEY")
51
+ url = args.url or os.getenv("POLY_API_BASE_URL")
52
+
53
+ if api_key and url:
54
+ set_api_key_and_url(url, api_key)
52
55
  else:
53
56
  initialize_config(force=True)
54
57
  # setup command should have default cache values
polyapi/config.py CHANGED
@@ -73,7 +73,7 @@ def get_api_key_and_url() -> Tuple[str | None, str | None]:
73
73
  return key, url
74
74
 
75
75
 
76
- def set_api_key_and_url(key: str, url: str):
76
+ def set_api_key_and_url(url: str, key: str):
77
77
  config = configparser.ConfigParser()
78
78
  config["polyapi"] = {}
79
79
  config.set("polyapi", "poly_api_key", key)
@@ -107,7 +107,7 @@ def initialize_config(force=False):
107
107
  print_yellow("\n".join(errors))
108
108
  sys.exit(1)
109
109
 
110
- set_api_key_and_url(key, url)
110
+ set_api_key_and_url(url, key)
111
111
  print_green("Poly setup complete.")
112
112
 
113
113
  if not key or not url:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.10.dev6
3
+ Version: 0.3.11.dev2
4
4
  Summary: The Python Client for PolyAPI, the IPaaS by Developers for Developers
5
5
  Author-email: Dan Fellin <dan@polyapi.io>
6
6
  License: MIT License
@@ -2,9 +2,9 @@ polyapi/__init__.py,sha256=hw7x4j9JNJfPdkIOZqV0X9pbYcw3_5AH1iQFdSogH-c,3235
2
2
  polyapi/__main__.py,sha256=V4zhAh_YGxno5f_KSrlkELxcuDh9bR3WSd0n-2r-qQQ,93
3
3
  polyapi/api.py,sha256=2nds6ZdNe9OHvCba4IjOPga0CAYIsib2SbhEyDDCmd8,2188
4
4
  polyapi/auth.py,sha256=EGstBjTSdAydI5hGAHeRRc1GcmHshogudb3sxCgO6zA,5341
5
- polyapi/cli.py,sha256=lsF9xgSGeten0sBRPPBV0c7z8QIy4stSybGTQKggPjQ,11100
5
+ polyapi/cli.py,sha256=KvDd6C3UbHCRI1vR8m5Usx3Sv_-bBI7LPqU_FLFsMLI,11198
6
6
  polyapi/client.py,sha256=DW6ljG_xCwAo2yz23A9QfLooE6ZUDvSpdA4e_dCQjiQ,1418
7
- polyapi/config.py,sha256=cAMv2n9tGN_BTvqt7V32o5F86qRhxAKyey_PoId2D8s,7638
7
+ polyapi/config.py,sha256=LgkZXG1DspNxIwukpcFTbsj46YyN5lQjmlvdVby87uQ,7638
8
8
  polyapi/constants.py,sha256=sc-FnS0SngBLvSu1ZWMs0UCf9EYD1u1Yhfr-sZXGLns,607
9
9
  polyapi/deployables.py,sha256=6R7XSgpTohZBcqoGd7GioQdXXKuvbBsdq_cAJ1p8jfQ,12184
10
10
  polyapi/error_handler.py,sha256=I_e0iz6VM23FLVQWJljxs2NGcl_OODbi43OcbnqBlp8,2398
@@ -25,8 +25,8 @@ polyapi/typedefs.py,sha256=VEaYODLm-3a26_cK1uSRoYwenmprLOQQdoKFz4gqK_0,5587
25
25
  polyapi/utils.py,sha256=Ca189i4PM4TpwvpzwF3T8MfQsOPD45b_falXjjgYCyI,12603
26
26
  polyapi/variables.py,sha256=SJv106ePpQP5mx7Iiafl_shtFlE8FoaO9Q8lvw-3IRg,7270
27
27
  polyapi/webhook.py,sha256=I3_uOl4f4L2-2WehzRLMVMRrB-76EiXCPA9Vzoaj30I,5326
28
- polyapi_python-0.3.10.dev6.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
29
- polyapi_python-0.3.10.dev6.dist-info/METADATA,sha256=Y6eWcEvxBbJ2-t-570Ic77bj4Ed-LtPhOc4v0XBF6yI,5318
30
- polyapi_python-0.3.10.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
- polyapi_python-0.3.10.dev6.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
32
- polyapi_python-0.3.10.dev6.dist-info/RECORD,,
28
+ polyapi_python-0.3.11.dev2.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
29
+ polyapi_python-0.3.11.dev2.dist-info/METADATA,sha256=jhbcFxknorQvZTBNK8395spXQyJyS9H2B6NUtLqZ338,5318
30
+ polyapi_python-0.3.11.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
+ polyapi_python-0.3.11.dev2.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
32
+ polyapi_python-0.3.11.dev2.dist-info/RECORD,,