<s> """<STR_LIT>""" <EOL> import sys <EOL> import traceback <EOL> class InvalidCommand ( Exception ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> self . not_found = kwargs . pop ( '<STR_LIT>' , None ) <EOL> super ( InvalidCommand , self ) . __init__ ( * args , ** kwargs ) <EOL> self . cmd_used = None <EOL> self . bin_name = '<STR_LIT>' <EOL> def __str__ ( self ) : <EOL> if self . not_found is None : <EOL> return super ( InvalidCommand , self ) . __str__ ( ) <EOL> if self . cmd_used : <EOL> msg_task_not_found = ( <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' ) <EOL> return msg_task_not_found . format ( ** self . __dict__ ) <EOL> else : <EOL> msg_cmd_task_not_found = ( <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' + <EOL> '<STR_LIT>' ) <EOL> return msg_cmd_task_not_found . format ( ** self . __dict__ ) <EOL> class InvalidDodoFile ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class InvalidTask ( Exception ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class CatchedException ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , msg , exception = None ) : <EOL> self . message = msg <EOL> self . traceback = '<STR_LIT>' <EOL> if isinstance ( exception , CatchedException ) : <EOL> self . traceback = exception . traceback <EOL> elif exception is not None : <EOL> self . traceback = traceback . format_exception ( <EOL> exception . __class__ , exception , sys . exc_info ( ) [ <NUM_LIT:2> ] ) <EOL> def get_msg ( self ) : <EOL> """<STR_LIT>""" <EOL> return "<STR_LIT>" % ( self . message , "<STR_LIT>" . join ( self . traceback ) ) <EOL> def get_name ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __class__ . __name__ <EOL> def __repr__ ( self ) : <EOL> return "<STR_LIT>" % ( self . get_name ( ) , self . message ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . get_name ( ) , self . get_msg ( ) ) <EOL> class TaskFailed ( CatchedException ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class UnmetDependency ( TaskFailed ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class TaskError ( CatchedException ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class SetupError ( CatchedException ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class DependencyError ( CatchedException ) : <EOL> """<STR_LIT>""" <EOL> pass </s>
