@@ -23,14 +23,14 @@ def __init__(
2323 token ,
2424 production : bool = True ,
2525 showInfo : bool = False ,
26- outPath : str | Path = "output" ,
26+ _out_path : str | Path = "output" ,
2727 timeout : int = 60 ,
2828 ):
2929 self .token = re .sub (r"[^a-zA-Z0-9\-]+" , "" , token )
3030 self .showInfo = showInfo
3131 self .timeout = timeout
3232 self .baseUrl = "https://data.oceannetworks.ca/"
33- self .outPath = Path (outPath )
33+ self ._out_path = Path (_out_path )
3434
3535 # switch to qa if needed
3636 if not production :
@@ -42,18 +42,21 @@ def __init__(
4242 self .realTime = _OncRealTime (self )
4343 self .archive = _OncArchive (self )
4444
45+ def set_out_path (self , out_path : str | Path ):
46+ self ._out_path = Path (out_path )
47+
4548 def print (self , obj , filename : str = "" ):
4649 """
4750 Helper for printing a JSON dictionary to the console or to a file
4851 @filename: if present, creates a file with a ".json" extension
49- in "self.outPath " directory, and writes the output to the file.
52+ in "self._out_path " directory, and writes the output to the file.
5053 if not present, prints the output to the console.
5154 """
5255 text = json .dumps (obj , indent = 4 )
5356 if filename == "" :
5457 print (text )
5558 else :
56- filePath = self .outPath / filename
59+ filePath = self ._out_path / filename
5760 filePath = filePath .with_suffix (".json" )
5861
5962 with open (filePath , "w+" ) as file :
0 commit comments