<s> from traits . api import HasPrivateTraits , Code , Str <EOL> from traitsui . api import View , Item , Handler , CodeEditor <EOL> from traitsui . key_bindings import KeyBinding , KeyBindings <EOL> key_bindings = KeyBindings ( <EOL> KeyBinding ( binding1 = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> method_name = '<STR_LIT>' ) , <EOL> KeyBinding ( binding1 = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> method_name = '<STR_LIT>' ) , <EOL> KeyBinding ( binding1 = '<STR_LIT>' , <EOL> description = '<STR_LIT>' , <EOL> method_name = '<STR_LIT>' ) <EOL> ) <EOL> class CodeHandler ( Handler ) : <EOL> def save_file ( self , info ) : <EOL> info . object . status = "<STR_LIT>" <EOL> def run_script ( self , info ) : <EOL> info . object . status = "<STR_LIT>" <EOL> def edit_bindings ( self , info ) : <EOL> info . object . status = "<STR_LIT>" <EOL> key_bindings . edit_traits ( ) <EOL> class TestCode ( HasPrivateTraits ) : <EOL> code = Code <EOL> status = Str <EOL> view = View ( <EOL> [ Item ( '<STR_LIT:code>' , <EOL> style = '<STR_LIT>' , <EOL> resizable = True , <EOL> editor = CodeEditor ( key_bindings = key_bindings ) ) , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' ] , <EOL> id = '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> width = <NUM_LIT> , <EOL> height = <NUM_LIT> , <EOL> resizable = True , <EOL> handler = CodeHandler ( ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> TestCode ( ) . configure_traits ( ) </s>
