Spaces:
Sleeping
Sleeping
sbgonenc96
commited on
Commit
•
65b0420
1
Parent(s):
000e53d
Update `get_reddit_config`
Browse filesNow the function is supposed to handle invalid config paths
- authentication.py +3 -2
authentication.py
CHANGED
@@ -5,8 +5,9 @@ import toml
|
|
5 |
|
6 |
|
7 |
def get_reddit_config(config_file_path):
|
8 |
-
|
9 |
-
|
|
|
10 |
|
11 |
def authenticate_reddit(config=None, **kwargs):
|
12 |
config = {
|
|
|
5 |
|
6 |
|
7 |
def get_reddit_config(config_file_path):
|
8 |
+
if os.path.exists(config_file_path):
|
9 |
+
return toml.load(config_file_path)["reddit"]
|
10 |
+
return None
|
11 |
|
12 |
def authenticate_reddit(config=None, **kwargs):
|
13 |
config = {
|