File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 11from datetime import datetime , timedelta , timezone
22from hashlib import sha1 , sha256
33from hmac import new as hmac
4+ from pathlib import Path
45from typing import Union
56
67import re
78import ssl
89import yaml
910
11+
1012from domaintools .constants import (
1113 Endpoint ,
1214 OutputFormat ,
@@ -111,17 +113,19 @@ def __init__(
111113 raise Exception ("Proxy URL must be a string. For example: '127.0.0.1:8888'" )
112114
113115 def _initialize_specs (self ):
116+ package_root = Path (__file__ ).parent
114117 for spec_name , file_path in SPECS_MAPPING .items ():
118+ specs_file_path = f"{ package_root } /specs/{ file_path } "
115119 try :
116- with open (file_path , "r" , encoding = "utf-8" ) as f :
120+ with open (specs_file_path , "r" , encoding = "utf-8" ) as f :
117121 spec_content = yaml .safe_load (f )
118122 if not spec_content :
119123 raise ValueError ("Spec file is empty or invalid." )
120124
121125 self .specs [spec_name ] = spec_content
122126
123127 except Exception as e :
124- print (f"Error loading { file_path } : { e } " )
128+ print (f"Error loading { specs_file_path } : { e } " )
125129
126130 def _get_ssl_default_context (self , verify_ssl : Union [str , bool ]):
127131 return (
Original file line number Diff line number Diff line change @@ -58,6 +58,6 @@ class OutputFormat(Enum):
5858}
5959
6060SPECS_MAPPING = {
61- "iris" : "domaintools/specs/ iris-openapi.yaml" ,
62- # "rttf": "domaintools/specs/ feeds-openapi.yaml",
61+ "iris" : "iris-openapi.yaml" ,
62+ # "rttf": "feeds-openapi.yaml",
6363}
You can’t perform that action at this time.
0 commit comments