<s> import os <EOL> import sublime <EOL> CMD_TARGET_APPLICATION = <NUM_LIT:0> <EOL> CMD_TARGET_WINDOW = <NUM_LIT:1> <EOL> CMD_TARGET_VIEW = <NUM_LIT:2> <EOL> CMD_RUN = '<STR_LIT>' <EOL> CMD_KEY = '<STR_LIT>' <EOL> CMD_SET = '<STR_LIT>' <EOL> def str_to_dict ( s ) : <EOL> """<STR_LIT>""" <EOL> d = { } <EOL> els = s . split ( '<STR_LIT:U+0020>' ) <EOL> for el in els : <EOL> key , value = el . split ( '<STR_LIT::>' ) <EOL> try : <EOL> d [ '<STR_LIT:key>' ] = eval ( value , { } , { } ) <EOL> except NameError : <EOL> d [ '<STR_LIT:key>' ] = value <EOL> return d <EOL> def run_ ( cmd ) : <EOL> target , predicate = cmd [ '<STR_LIT:target>' ] , cmd [ '<STR_LIT>' ] <EOL> if cmd [ '<STR_LIT>' ] : <EOL> if cmd [ '<STR_LIT>' ] : <EOL> target . run_command ( '<STR_LIT>' ) <EOL> return <EOL> cmd_ , _ , args = predicate . partition ( '<STR_LIT:U+0020>' ) <EOL> if args : <EOL> args = str_to_dict ( args ) <EOL> else : <EOL> args = { } <EOL> if not cmd [ '<STR_LIT>' ] : <EOL> target . run_command ( str ( cmd_ ) , args ) <EOL> def set_ ( cmd ) : <EOL> target , predicate = cmd [ '<STR_LIT:target>' ] , cmd [ '<STR_LIT>' ] <EOL> if cmd [ '<STR_LIT>' ] : <EOL> if cmd [ '<STR_LIT>' ] : <EOL> syntax = os . path . basename ( target . settings ( ) . get ( '<STR_LIT>' ) ) <EOL> target . run_command ( '<STR_LIT>' , { <EOL> '<STR_LIT>' : syntax , <EOL> '<STR_LIT>' : predicate <EOL> } ) <EOL> return <EOL> if not target . settings ( ) . has ( predicate ) : <EOL> sublime . status_message ( '<STR_LIT>' % predicate ) <EOL> return <EOL> msg = "<STR_LIT>" % ( predicate , target . settings ( ) . get ( predicate ) ) <EOL> sublime . status_message ( msg ) <EOL> return <EOL> try : <EOL> name , _ , value = predicate . partition ( '<STR_LIT:U+0020>' ) <EOL> target . settings ( ) . set ( name , eval ( value , { } , { } ) ) <EOL> msg = "<STR_LIT>" % ( name , target . settings ( ) . get ( name ) ) <EOL> sublime . status_message ( msg ) <EOL> except ValueError , e : <EOL> sublime . status_message ( '<STR_LIT>' ) <EOL> raise e <EOL> def key_ ( args ) : <EOL> print "<STR_LIT>" </s>
