|
1 | 1 | # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_core.ipynb. |
2 | 2 |
|
3 | 3 | # %% auto 0 |
4 | | -__all__= ['dh_port','Placements','empty','find_var','call_endp','find_dname','find_msg_id','curr_dialog','find_msgs', |
| 4 | +__all__= ['dh_settings','Placements','empty','find_var','call_endp','find_dname','find_msg_id','curr_dialog','find_msgs', |
5 | 5 | 'msg_idx','add_html','add_msg','del_msg','update_msg','url2note','ast_py','ast_grep','read_msg', |
6 | 6 | 'run_msg','msg_insert_line','msg_str_replace','msg_strs_replace','msg_replace_lines','load_gist', |
7 | 7 | 'gist_file','import_string','is_usable_tool','mk_toollist','import_gist','tool_info','fc_tool_info', |
@@ -39,12 +39,12 @@ def find_var(var:str): |
39 | 39 | raiseValueError(f"Could not find{var} in any scope") |
40 | 40 |
|
41 | 41 | # %% ../nbs/00_core.ipynb |
42 | | -dh_port=5001 |
| 42 | +dh_settings={'port':5001} |
43 | 43 |
|
44 | 44 | defcall_endp(path,dname='',json=False,raiseex=False,**data): |
45 | 45 | ifnotdname:dname=find_dname() |
46 | 46 | data['dlg_name']=dname |
47 | | -res=xpost(f'http://localhost:{dh_port}/{path}',data=data) |
| 47 | +res=xpost(f'http://localhost:{dh_settings["port"]}/{path}',data=data) |
48 | 48 | ifraiseex:res.raise_for_status() |
49 | 49 | try:returnres.json()ifjsonelseres.text |
50 | 50 | exceptExceptionase:returnstr(e) |
|