-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement email callback, custom exceptions
- Loading branch information
Showing
8 changed files
with
213 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import os | ||
import json | ||
from pathlib import Path | ||
|
||
|
||
# Create internal jort directory | ||
JORT_DIR = f"{os.path.expanduser('~')}/.jort" | ||
Path(f"{JORT_DIR}/").mkdir(mode=0o700, parents=True, exist_ok=True) | ||
Path(f"{JORT_DIR}/config").touch(mode=0o600, exist_ok=True) | ||
Path(f"{JORT_DIR}/config").touch(mode=0o600, exist_ok=True) | ||
|
||
|
||
def get_config_data(): | ||
with open(f"{JORT_DIR}/config", "r") as f: | ||
try: | ||
config_data = json.load(f) | ||
except json.decoder.JSONDecodeError: | ||
config_data = {} | ||
return config_data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class JortException(Exception): | ||
pass | ||
|
||
|
||
class JortCredentialException(JortException): | ||
""" | ||
Exception for missing credentials. | ||
""" | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.