def import_files(files):
    success_count = 0
    for afile in files:
        try:
            success_count += wbz_handler.handle_file(afile)
        except (__HOLE__, KeyError, ValueError), e:
            mbox = gtk.MessageDialog(type=gtk.MESSAGE_ERROR,
                                     buttons=gtk.BUTTONS_OK)
            mbox.set_title(_("File import error."))
            mbox.set_markup(_("Could not import '%s': %s") % (afile, e))
            mbox.run()
            mbox.destroy()

    if success_count:
        mbox = gtk.MessageDialog(type=gtk.MESSAGE_INFO,
                                 buttons=gtk.BUTTONS_OK)
        mbox.set_title(_("Import complete."))
        mbox.set_markup(_("%d photos have been added to your collection.")
                        % success_count)
        mbox.run()
        mbox.destroy()
dataset/ETHPy150Open thesamet/webilder/src/webilder/WebilderDesktop.py/import_files