<s> class ParserError ( Exception ) : <EOL> pass <EOL> class Parser : <EOL> parser_output = None <EOL> def __init__ ( self ) : <EOL> pass <EOL> def get_file_ext ( self ) : <EOL> raise NotImplementedError ( '<STR_LIT>' ) <EOL> def parse ( self , atlas_data ) : <EOL> raise NotImplementedError ( '<STR_LIT>' ) <EOL> def is_ready_to_save ( self ) : <EOL> return self . parser_output is not None and len ( self . parser_output ) > <NUM_LIT:0> <EOL> def save ( self , filename ) : <EOL> if not self . is_ready_to_save ( ) : <EOL> raise ParserError ( '<STR_LIT>' ) <EOL> file = open ( filename , '<STR_LIT:w>' ) <EOL> file . write ( self . parser_output ) </s>
