From 8b90db99774a48fcae3d4f74f94cee69d7fd2ed1 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Mon, 25 Jan 2016 22:05:41 -0500 Subject: Read the config file from the absolute path. --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 3f8cef1..22fc2ac 100755 --- a/main.py +++ b/main.py @@ -28,7 +28,10 @@ if __name__ == "__main__": args = parser.parse_args() config = ConfigParser.ConfigParser() - config.read('settings.cfg') + configfile = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'settings.cfg') + if args.v: + print "[Pre-Logging] Reading config from", configfile + config.read(configfile) if not config.get('email', 'user') or \ not config.get('email', 'pass') or \ not config.get('email', 'smtpserver') or \ -- cgit v1.2.3