<s> from enaml . widgets . file_dialog import ProxyFileDialog <EOL> from . q_deferred_caller import deferredCall <EOL> from . q_file_dialog_helper import get_file_dialog_exec_func <EOL> from . qt_toolkit_object import QtToolkitObject <EOL> class QtFileDialog ( QtToolkitObject , ProxyFileDialog ) : <EOL> """<STR_LIT>""" <EOL> def exec_dialog ( self ) : <EOL> """<STR_LIT>""" <EOL> d = self . declaration <EOL> path = d . path <EOL> caption = d . title <EOL> filters = '<STR_LIT>' . join ( d . filters ) <EOL> selected_filter = d . selected_filter <EOL> exec_func = get_file_dialog_exec_func ( d . mode ) <EOL> if d . mode == '<STR_LIT>' : <EOL> path , selected_filter = exec_func ( <EOL> self . parent_widget ( ) , caption , path , filters , selected_filter <EOL> ) <EOL> paths = [ path ] if path else [ ] <EOL> elif d . mode == '<STR_LIT>' : <EOL> paths , selected_filter = exec_func ( <EOL> self . parent_widget ( ) , caption , path , filters , selected_filter <EOL> ) <EOL> elif d . mode == '<STR_LIT>' : <EOL> path , selected_filter = exec_func ( <EOL> self . parent_widget ( ) , caption , path , filters , selected_filter <EOL> ) <EOL> paths = [ path ] if path else [ ] <EOL> else : <EOL> path = exec_func ( self . parent_widget ( ) , caption , path ) <EOL> paths = [ path ] if path else [ ] <EOL> result = '<STR_LIT>' if paths else '<STR_LIT>' <EOL> d . _handle_close ( result , paths , selected_filter ) <EOL> def open ( self ) : <EOL> """<STR_LIT>""" <EOL> deferredCall ( self . exec_dialog ) <EOL> def exec_ ( self ) : <EOL> """<STR_LIT>""" <EOL> self . exec_dialog ( ) </s>
