From 0e8101d64ceb1cb0d3a02768328d3ca2d20084ae Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Thu, 23 Aug 2018 14:44:28 -0500 Subject: [PATCH] Config now expected next to geoffrey.py and console logging fixed. --- geoffrey/BotConfig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/geoffrey/BotConfig.py b/geoffrey/BotConfig.py index 2100dc8..eb53bfa 100644 --- a/geoffrey/BotConfig.py +++ b/geoffrey/BotConfig.py @@ -1,5 +1,6 @@ import codecs import configparser +import os def create_config(config): @@ -30,7 +31,8 @@ def create_config(config): def read_config(): config = configparser.ConfigParser() - config.read_file(codecs.open("GeoffreyConfig.ini", "r", "utf8")) + path = os.path.dirname(os.path.abspath(__file__)) + config.read_file(codecs.open("{}/GeoffreyConfig.ini".format(path), "r", "utf8")) if len(config.sections()) == 0: create_config(config)