From 2fc6f47bb9a973a2644d36d77d7fca4930a1df62 Mon Sep 17 00:00:00 2001 From: KRKeegan <-NOSPAM-kevin@krkeegan.com> Date: Fri, 2 May 2008 16:23:19 -0700 Subject: [PATCH] Throw and error and exit if pyTivo.conf does not exist --- config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config.py b/config.py index 9b91a7b..acf72e0 100644 --- a/config.py +++ b/config.py @@ -1,10 +1,14 @@ -import ConfigParser, os +import ConfigParser, os, sys import re from ConfigParser import NoOptionError config = ConfigParser.ConfigParser() p = os.path.dirname(__file__) config_file = os.path.join(p, 'pyTivo.conf') +if not os.path.exists(config_file): + print 'ERROR: pyTivo.conf does not exist.\n' + \ + 'You must create this file before running pyTivo.' + sys.exit(1) config.read(config_file) def reset(): -- 2.11.4.GIT