Skip to content

Commit

Permalink
#75: Use __file__ to get relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
keiranjprice101 committed Oct 9, 2019
1 parent 620a248 commit 6d1f323
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
class Config(object):

def __init__(self):
with open(Path("config.json")) as target:
config_path = Path(__file__).parent.parent / "config.json"
with open(config_path) as target:

self.config = json.load(target)
target.close()
Expand Down
2 changes: 1 addition & 1 deletion common/logger_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from common.config import config

log_level = "DEBUG"
LOG_FILE_NAME = Path("logs.log")
LOG_FILE_NAME = Path(__file__).parent.parent / "logs.log"
logger_config = {
"version": 1,
"formatters": {"default": {
Expand Down

0 comments on commit 6d1f323

Please sign in to comment.