File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 99APP_DIR : str = dirname (realpath (argv [0 ]))
1010
1111def read (filepath : str ) -> str | None :
12+ filepath = join (APP_DIR , filepath )
1213 if not exists (filepath ):
1314 return None
1415
15- full_path : str = join (APP_DIR , filepath )
16- with open (full_path , 'r' ) as file :
16+ with open (filepath , 'r' ) as file :
1717 return file .read ()
1818
1919def write (filepath : str , content : str ) -> bool :
20+ filepath = join (APP_DIR , filepath )
2021 folder_path : str = "/" .join (filepath .split ('/' )[:- 1 ])
22+
2123 if not exists (folder_path ):
2224 makedirs (folder_path , exist_ok = True )
2325
24- full_path : str = join (APP_DIR , filepath )
25- with open (full_path , 'w' ) as file :
26+ with open (filepath , 'w' ) as file :
2627 file .write (content )
2728
2829 return True
@@ -31,7 +32,7 @@ def read_config(
3132 config : str ,
3233 cached_return : bool = True
3334) -> str | None :
34- config_path : str = f"configs/{ config } .txt"
35+ config_path : str = f"../ configs/{ config } .txt"
3536 if cached_return and config_path in cached_data :
3637 return cached_data [config_path ]
3738
You can’t perform that action at this time.
0 commit comments