<s> """<STR_LIT>""" <EOL> import sublime <EOL> ERR_FILE_EXISTS = <NUM_LIT> <EOL> ERR_ADDRESS_REQUIRED = <NUM_LIT> <EOL> ERR_INVALID_ADDRESS = <NUM_LIT> <EOL> ERR_INVALID_RANGE = <NUM_LIT:16> <EOL> ERR_NO_FILE_NAME = <NUM_LIT:32> <EOL> ERR_UNSAVED_CHANGES = <NUM_LIT> <EOL> ERR_READONLY_FILE = <NUM_LIT> <EOL> ERR_UNDEFINED_VARIABLE = <NUM_LIT> <EOL> ERR_CANT_MOVE_LINES_ONTO_THEMSELVES = <NUM_LIT> <EOL> ERR_CANT_WRITE_FILE = <NUM_LIT> <EOL> ERR_CANT_FIND_DIR_IN_CDPATH = <NUM_LIT> <EOL> ERR_OTHER_BUFFER_HAS_CHANGES = <NUM_LIT> <EOL> ERR_INVALID_ARGUMENT = <NUM_LIT> <EOL> ERR_NO_BANG_ALLOWED = <NUM_LIT> <EOL> ERR_NO_RANGE_ALLOWED = <NUM_LIT> <EOL> ERR_TRAILING_CHARS = <NUM_LIT> <EOL> ERR_UNKNOWN_COMMAND = <NUM_LIT> <EOL> ERR_EMPTY_BUFFER = <NUM_LIT> <EOL> ERR_MESSAGES = { <EOL> ERR_FILE_EXISTS : '<STR_LIT>' , <EOL> ERR_ADDRESS_REQUIRED : '<STR_LIT>' , <EOL> ERR_INVALID_ADDRESS : '<STR_LIT>' , <EOL> ERR_INVALID_RANGE : '<STR_LIT>' , <EOL> ERR_NO_FILE_NAME : '<STR_LIT>' , <EOL> ERR_UNSAVED_CHANGES : '<STR_LIT>' , <EOL> ERR_READONLY_FILE : "<STR_LIT>" , <EOL> ERR_UNDEFINED_VARIABLE : "<STR_LIT>" , <EOL> ERR_CANT_MOVE_LINES_ONTO_THEMSELVES : "<STR_LIT>" , <EOL> ERR_CANT_WRITE_FILE : "<STR_LIT>" , <EOL> ERR_CANT_FIND_DIR_IN_CDPATH : "<STR_LIT>" , <EOL> ERR_OTHER_BUFFER_HAS_CHANGES : "<STR_LIT>" , <EOL> ERR_INVALID_ARGUMENT : "<STR_LIT>" , <EOL> ERR_NO_BANG_ALLOWED : '<STR_LIT>' , <EOL> ERR_NO_RANGE_ALLOWED : '<STR_LIT>' , <EOL> ERR_TRAILING_CHARS : '<STR_LIT>' , <EOL> ERR_UNKNOWN_COMMAND : '<STR_LIT>' , <EOL> ERR_EMPTY_BUFFER : '<STR_LIT>' , <EOL> } <EOL> class Display : <EOL> NONE = <NUM_LIT:0> <EOL> STATUS = <NUM_LIT:1> <EOL> CONSOLE = <NUM_LIT:1> << <NUM_LIT:1> <EOL> ALL = STATUS | CONSOLE <EOL> class VimError ( Exception ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , code , * args , ** kwargs ) : <EOL> self . code = code <EOL> self . message = get_error_message ( code ) <EOL> super ( ) . __init__ ( * args , ** kwargs ) <EOL> def __str__ ( self ) : <EOL> return '<STR_LIT>' . format ( self . code , self . message ) <EOL> def show_message ( message , displays = Display . CONSOLE ) : <EOL> '''<STR_LIT>''' <EOL> message = '<STR_LIT>' . format ( message ) <EOL> if displays == Display . NONE : <EOL> return <EOL> if ( displays & Display . CONSOLE ) == Display . CONSOLE : <EOL> print ( message ) <EOL> if ( displays & Display . STATUS ) == Display . STATUS : <EOL> sublime . status_message ( message ) <EOL> def show_status ( message ) : <EOL> '''<STR_LIT>''' <EOL> show_message ( message , displays = Display . STATUS ) <EOL> def show_error ( error , displays = Display . ALL , log = False ) : <EOL> '''<STR_LIT>''' <EOL> assert isinstance ( error , Exception ) , "<STR_LIT>" <EOL> show_message ( str ( error ) , displays = displays ) <EOL> def show_not_implemented ( message = None , displays = Display . ALL ) : <EOL> message = message if message else '<STR_LIT>' <EOL> show_message ( message , displays = displays ) <EOL> def get_error_message ( error_code ) : <EOL> return ERR_MESSAGES . get ( error_code , '<STR_LIT>' ) </s>
