aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ritter <tom@ritter.vg>2016-01-25 22:05:41 -0500
committerTom Ritter <tom@ritter.vg>2016-01-25 22:05:41 -0500
commit8b90db99774a48fcae3d4f74f94cee69d7fd2ed1 (patch)
treeb797771e5ec66b204352626005464517d905631a
parent4a42c0a83c9b50600c26c5816c0d666a44910d10 (diff)
Read the config file from the absolute path.
-rwxr-xr-xmain.py5
1 files changed, 4 insertions, 1 deletions
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 \