def METHOD_NAME(self, event=None):
    """generate script to import groups"""
    namelist = [self.allgroups[n] for n in self.grouplist.GetCheckedStrings()]
    if len(namelist) == 0:
        cancel = Popup(self, """No data groups selected.
    Cancel import from this project?""", 'Cancel Import?',
                       style=wx.YES_NO)
        if wx.ID_YES == cancel:
            self.Destroy()
        else:
            return
    if self.read_ok_cb is not None:
        self.read_ok_cb(self.filename, namelist)
    self.Destroy()