Skip to content

Commit

Permalink
Support dicts in docstring main text
Browse files Browse the repository at this point in the history
  • Loading branch information
stellabelin committed May 30, 2024
1 parent 9349da0 commit ce6188e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions deploy/help_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def py_to_r_str(arg, example=False):
if not example:
py_to_r_dict = {**py_to_r_dict, **{r'\[([0-9]+)\]_*': r'(\1)'}}
py_to_r_dict = {**py_to_r_dict, **{r'\[([\'\"\w(),\s]+)]': r'c(\1)'}}
py_to_r_dict = {**py_to_r_dict, **{r'\{(.+:.+,*)+\}': r'list(\1)'}}
py_to_r_dict = {**py_to_r_dict, **{
r'list\(((.+):(.+),*)+\)': lambda x: x.group().replace(':', "=".format(x.group(1)))}
}

arg_sub = arg
for key, value in py_to_r_dict.items():
Expand Down

0 comments on commit ce6188e

Please sign in to comment.