def evt_popup_file_window(self): if self.generating_file_list_flg == 1: return dialog_icon = tkFileDialog.Open(master=self.parent.control_frame2, filetypes=pub_controls.filetypes, title='File Open Selection') dirfilename = dialog_icon.show(initialdir=os.getcwd()) if dirfilename in [(), '']: return # Set up the thread to do asynchronous I/O self.stop_listing_flg = 0 self.parent.parent.busyCursor = 'watch' self.parent.parent.busyWidgets = [ self.parent.parent.pane2.pane('EditPaneTop') ] # Note: this busy cursor is reset in open_text_file pub_busy.busyStart(self.parent.parent) # Remove the old list if self.parent.parent.file_counter > 0: self.parent.parent.pub_editorviewer.sf.destroy() self.parent.parent.pub_editorviewer = pub_editorviewer.create_publisher_editor_viewer( self.parent.parent) self.parent.parent.log_window.appendtext("Creating the file list...\n") self.generating_file_list_flg = 1 lock = thread.allocate_lock() thread.start_new_thread(self.open_text_file, (dirfilename, lock))
def evt_popup_file_window( self ): if self.generating_file_list_flg == 1: return dialog_icon = tkFileDialog.Open(master=self.parent.control_frame2, filetypes=pub_controls.filetypes, title = 'File Open Selection') dirfilename=dialog_icon.show(initialdir=os.getcwd()) if dirfilename in [(), '']: return # Set up the thread to do asynchronous I/O self.stop_listing_flg = 0 self.parent.parent.busyCursor = 'watch' self.parent.parent.busyWidgets = [self.parent.parent.pane2.pane( 'EditPaneTop' )] # Note: this busy cursor is reset in open_text_file pub_busy.busyStart(self.parent.parent) # Remove the old list if self.parent.parent.file_counter > 0: self.parent.parent.pub_editorviewer.sf.destroy() self.parent.parent.pub_editorviewer = pub_editorviewer.create_publisher_editor_viewer( self.parent.parent ) self.parent.parent.log_window.appendtext("Creating the file list...\n") self.generating_file_list_flg = 1 lock=thread.allocate_lock() thread.start_new_thread( self.open_text_file, (dirfilename,lock) )
def evt_popup_directory_window(self): if self.generating_file_list_flg == 1: return dialog_icon = tkFileDialog.Directory( master=self.parent.control_frame2, title='Directory and File Selection') dirfilename = dialog_icon.show(initialdir=os.getcwd()) if dirfilename in [(), '']: return self.stop_listing_flg = 0 self.extension = [] self.parent.extension.append( (self.data_filter._entryfield.get().split()[-1])) # Set up the thread to do asynchronous I/O self.stop_listing_flg = 0 self.parent.parent.busyCursor = 'watch' self.parent.parent.busyWidgets = [ self.parent.parent.pane2.pane('EditPaneTop') ] # note this busy cursor is reset in the method myfun3 pub_busy.busyStart(self.parent.parent) # Remove the old list if self.parent.parent.file_counter > 0: self.parent.parent.pub_editorviewer.sf.destroy() self.parent.parent.pub_editorviewer = pub_editorviewer.create_publisher_editor_viewer( self.parent.parent) self.parent.parent.log_window.appendtext("Creating the file list...\n") self.generating_file_list_flg = 1 lock = thread.allocate_lock() thread.start_new_thread(self.myfun3, (dirfilename, lock))
def evt_popup_directory_window( self ): if self.generating_file_list_flg == 1: return dialog_icon = tkFileDialog.Directory(master=self.parent.control_frame2, title = 'Directory and File Selection') dirfilename=dialog_icon.show(initialdir=os.getcwd()) if dirfilename in [(), '']: return self.stop_listing_flg = 0 self.extension = [] self.parent.extension.append( (self.data_filter._entryfield.get().split()[-1]) ) # Set up the thread to do asynchronous I/O self.stop_listing_flg = 0 self.parent.parent.busyCursor = 'watch' self.parent.parent.busyWidgets = [self.parent.parent.pane2.pane( 'EditPaneTop' )] # note this busy cursor is reset in the method myfun3 pub_busy.busyStart(self.parent.parent) # Remove the old list if self.parent.parent.file_counter > 0: self.parent.parent.pub_editorviewer.sf.destroy() self.parent.parent.pub_editorviewer = pub_editorviewer.create_publisher_editor_viewer( self.parent.parent ) self.parent.parent.log_window.appendtext("Creating the file list...\n") self.generating_file_list_flg = 1 lock=thread.allocate_lock() thread.start_new_thread( self.myfun3, (dirfilename,lock) )