Changeset 350

Show
Ignore:
Timestamp:
09/10/08 23:57:56 (4 months ago)
Author:
andy
Message:

Add in try/except block around removing lockfiles, when already inside an exception handler, so we dont mask a more serious exception

Also, parse the 'indytube.conf' file from the directory that the script starts from.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • indytube/branches/plumi-0.2.1/indytube.py

    r349 r350  
    185185                                        except: 
    186186                                                logging.info("Error while processing %s: %s" % (videofile,traceback.format_exc())) 
    187                                                 os.remove(lockfile) 
    188                                                 #remove this process's lockfile, this exception will stop the entire process 
    189                                                 os.remove(self.ENCODER_LOCKFILE) 
     187                                                try: 
     188                                                        os.remove(lockfile) 
     189                                                        #remove this process's lockfile, this exception will stop the entire process 
     190                                                        os.remove(self.ENCODER_LOCKFILE) 
     191                                                except: 
     192                                                        pass 
    190193 
    191194                                else: 
     
    216219    indytuber = IndyTubeTranscoder() 
    217220    #parse our config 
    218     indytuber.parse_config('indytube.conf') 
     221    #find the indytube.conf in the directory that script runs from 
     222    indyconf_path = os.path.dirname(sys.argv[0]) + '/indytube.conf' 
     223    indytuber.parse_config(indyconf_path) 
    219224    #we have started! 
    220225    logging.info("started main function at %s, calling loop every %s seconds " % (time.strftime("%D %H:%M:%S"), indytuber.POLLTIME))