Skip to content

Commit

Permalink
Fix staging link bug 2 (#3052)
Browse files Browse the repository at this point in the history
  • Loading branch information
andf-viam authored Jun 20, 2024
1 parent 3187a9e commit 9961591
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/update_sdk_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,10 @@ def parse(type, names):
if strong_tag.parent.find('a', class_="reference internal"):
param_type_link_raw = strong_tag.parent.find('a', class_="reference internal").get("href")
## Parameter type link is an anchor link:
if param_type_link_raw.startswith('#'):
if param_type_link_raw.startswith('#') and python_staging_url == '':
this_method_parameters_dict["param_type"] = '[' + param_type + '](' + url + param_type_link_raw + ')'
elif return_type_link_raw.startswith('#') and python_staging_url != '':
this_method_parameters_dict["param_type"] = '[' + param_type + '](' + url.replace(python_staging_url, sdk_url) + param_type_link_raw + ')'
## Parameter type link is a relative link, beginning with 1 - 3 instances of '../'
## Convert to an absolute link:
elif param_type_link_raw.startswith('../') \
Expand Down Expand Up @@ -1132,7 +1134,9 @@ def parse(type, names):
return_type_link_raw = return_tag.find('a', class_="reference internal").get("href")

## Return type link is an anchor link:
if return_type_link_raw.startswith('#'):
if return_type_link_raw.startswith('#') and python_staging_url == '':
this_method_dict["return"]["return_type"] = '[' + return_type + '](' + url + return_type_link_raw + ')'
elif return_type_link_raw.startswith('#') and python_staging_url != '':
this_method_dict["return"]["return_type"] = '[' + return_type + '](' + url.replace(python_staging_url, sdk_url) + return_type_link_raw + ')'
## Return type link is a relative link, beginning with 1 - 3 instances of '../'
## Convert to an absolute link:
Expand Down

0 comments on commit 9961591

Please sign in to comment.