예제 #1
0
 def execScript(self, file_name):
     try:
         with open(file_name, 'r', encoding='UTF-8') as fi:
             script = fi.read()
             fi.close()
             exec(script, {
                 'os': os,
                 'sys': sys,
                 'Log': Log,
                 'BuildUtility': BuildUtility
             }, {
                 'tool': self,
                 'genv': self.global_env
             })
     except FileNotFoundError:
         Log.e('Script "%s" not found' % file_name)
         raise
예제 #2
0
 def run(self):
     while True:
         if self.queue.isBreak():
             Log.d('Quit thread %d' % self.index)
             break
         job = self.queue.popJob()
         if job == None:
             Log.d('End thread %d' % self.index)
             break
         #print( ' Run %d' % self.index )
         try:
             code = job.run()
         except BuildUtility.FLB_Error as err:
             Log.e(err)
             code = 100
         except:
             Log.e('Exception! in thread %d' % self.index)
             raise
         if code != 0:
             self.queue.setBreak(code)
             break