From 2f28e4bd5e70c1c26d2e5b61115c403f66f6f531 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 6 Jul 2011 18:18:50 -0400 Subject: [PATCH] check for required configuration variables --- pygtk-imap-chk.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pygtk-imap-chk.py b/pygtk-imap-chk.py index 0c832ba..b5c6012 100755 --- a/pygtk-imap-chk.py +++ b/pygtk-imap-chk.py @@ -41,6 +41,14 @@ def main(argv): config_fname = argv[1] conf = get_config(config_fname) + if not ('server' in conf + and 'port' in conf + and 'user' in conf + and 'password' in conf): + sys.stderr.write( + 'Must specify server, port, user, and password' + ' in configuration file\n') + return 1 window = Window(conf) window.run()