aubiotempo~.c: update to 0.4.0
[pd-aubio.git] / waflib / Errors.py
1 #! /usr/bin/env python
2 # encoding: utf-8
3 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
5 import traceback,sys
6 class WafError(Exception):
7         def __init__(self,msg='',ex=None):
8                 self.msg=msg
9                 assert not isinstance(msg,Exception)
10                 self.stack=[]
11                 if ex:
12                         if not msg:
13                                 self.msg=str(ex)
14                         if isinstance(ex,WafError):
15                                 self.stack=ex.stack
16                         else:
17                                 self.stack=traceback.extract_tb(sys.exc_info()[2])
18                 self.stack+=traceback.extract_stack()[:-1]
19                 self.verbose_msg=''.join(traceback.format_list(self.stack))
20         def __str__(self):
21                 return str(self.msg)
22 class BuildError(WafError):
23         def __init__(self,error_tasks=[]):
24                 self.tasks=error_tasks
25                 WafError.__init__(self,self.format_error())
26         def format_error(self):
27                 lst=['Build failed']
28                 for tsk in self.tasks:
29                         txt=tsk.format_error()
30                         if txt:lst.append(txt)
31                 return'\n'.join(lst)
32 class ConfigurationError(WafError):
33         pass
34 class TaskRescan(WafError):
35         pass
36 class TaskNotReady(WafError):
37         pass