Logo Search packages:      
Sourcecode: catfish version File versions  Download package

def catfish::catfish::on_menu_save (   self,
Show a save dialog and possibly write the results to a file.

Definition at line 837 of file catfish.py.

        """Show a save dialog and possibly write the results to a file."""

        filename = self.get_save_dialog(self.window_search)
        if os.path.exists(filename):
            if not self.get_yesno_dialog(('The file %s already exists. Do you '
             + 'want to overwrite it?') % filename, self.window_search):
                filename = None
        if filename <> None:
                save = open(filename, 'w')
                listmodel = self.treeview_files.get_model()
                for item in range(len(listmodel)):
                    treeiter = listmodel.iter_nth_child(None, item)
                    name, path = self.get_selected_filename(self.treeview_files, treeiter)
                    save.write(os.path.join(name, path) + os.linesep)
            except Exception, msg:
                if self.options.debug: print 'Debug:', msg
                self.get_error_dialog('The file %s could not be saved.'
                 % filename, self.window_search)


Generated by  Doxygen 1.6.0   Back to index