Changeset 238 for indytube/trunk

Show
Ignore:
Timestamp:
10/14/07 22:30:06 (15 months ago)
Author:
andy
Message:

make a default location for the configuration file
and dont start unless it exists

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • indytube/trunk/indytube.py

    r230 r238  
    1515#twisted networking 
    1616from twisted.internet import reactor 
     17 
     18CONF_FILE_DEFAULT = '/etc/indytube/indytube.conf' 
    1719 
    1820class IndyTubeTranscoder(object): 
     
    225227    indytuber = IndyTubeTranscoder() 
    226228    #parse our config 
    227     indytuber.parse_config('indytube.conf') 
     229    if not (os.path.exists(CONF_FILE_DEFAULT)): 
     230        logging.error("cannot find configuration file %s " % (CONF_FILE_DEFAULT)) 
     231        #leave 
     232        sys.exit(0) 
     233 
     234    #ok, parse the file 
     235    indytuber.parse_config(CONF_FILE_DEFAULT) 
    228236 
    229237    #we have started!