polyapi-python 0.3.7.dev3__py3-none-any.whl → 0.3.7.dev4__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/utils.py CHANGED
@@ -222,6 +222,12 @@ def _maybe_add_fallback_schema_name(a: PropertySpecification):
222
222
  schema["title"] = a["name"].title()
223
223
 
224
224
 
225
+ def _clean_description(text: str) -> str:
226
+ """Flatten new-lines and collapse excess whitespace."""
227
+ text = text.replace("\\n", " ").replace("\n", " ")
228
+ return re.sub(r"\s+", " ", text).strip()
229
+
230
+
225
231
  def parse_arguments(
226
232
  function_name: str, arguments: List[PropertySpecification]
227
233
  ) -> Tuple[str, str]:
@@ -248,8 +254,8 @@ def parse_arguments(
248
254
  if not a.get("required", True):
249
255
  arg_string += " = None"
250
256
 
251
- description = a.get("description", "")
252
- description = description.replace("\n", " ")
257
+ description = _clean_description(a.get("description", ""))
258
+
253
259
  if description:
254
260
  if idx == len(arguments) - 1:
255
261
  arg_string += f" # {description}\n"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: polyapi-python
3
- Version: 0.3.7.dev3
3
+ Version: 0.3.7.dev4
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
@@ -21,11 +21,11 @@ polyapi/schema.py,sha256=ZSzeUjpqigLvE4tFKB7y4AaZG-W5N5Z9wMH-F-vjMBU,4616
21
21
  polyapi/server.py,sha256=YXWxhYBx-hluwDQ8Jvfpy2s8ogz0GsNTMcZVNcP5ca8,2147
22
22
  polyapi/sync.py,sha256=PGdC0feBBjEVrF3d9EluW_OAxbWuzSrfh84czma8kWg,6476
23
23
  polyapi/typedefs.py,sha256=MGDwWaijLNqokXF9UCHGAP-yKixOzztrH4Lsj800AJs,2328
24
- polyapi/utils.py,sha256=ehRD5o0fGJPtXEEeX8rXPmbzPzVLfLimHC2lzBkNUGs,11672
24
+ polyapi/utils.py,sha256=pHDwx4zDHKe0m2ZERo86DfI8ep42c0h1TyJpKqHxkgc,11844
25
25
  polyapi/variables.py,sha256=j7WWrGLr2O5SkWGxnsusnnfl25kVL3b6SQYcVGEoC8c,4277
26
26
  polyapi/webhook.py,sha256=LWv28c2MLz_OKBI_Nn7WR4C-gs1SWgbdXsoxIIf-9UI,4886
27
- polyapi_python-0.3.7.dev3.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
28
- polyapi_python-0.3.7.dev3.dist-info/METADATA,sha256=qoFbCNu-kAltunwz4xR5hYvBAm9ErCMaLPHKvg5TjUQ,5782
29
- polyapi_python-0.3.7.dev3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
- polyapi_python-0.3.7.dev3.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
31
- polyapi_python-0.3.7.dev3.dist-info/RECORD,,
27
+ polyapi_python-0.3.7.dev4.dist-info/licenses/LICENSE,sha256=6b_I7aPVp8JXhqQwdw7_B84Ca0S4JGjHj0sr_1VOdB4,1068
28
+ polyapi_python-0.3.7.dev4.dist-info/METADATA,sha256=_F2hAG7HAELadV-PMhmTGAj1t0i6jsOhFWWdAR-P_bU,5782
29
+ polyapi_python-0.3.7.dev4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
+ polyapi_python-0.3.7.dev4.dist-info/top_level.txt,sha256=CEFllOnzowci_50RYJac-M54KD2IdAptFsayVVF_f04,8
31
+ polyapi_python-0.3.7.dev4.dist-info/RECORD,,