

def __init__(self, mode, validate=False):
    if (mode == self.RESTORE_MODE):
        self.mode_name = self.RESTORE_MODE
        self.xform_filter = ADD_TO_ES_FILTER['archived_forms']
        self.button_text = _('Restore selected Forms')
        self.button_class = _('btn-primary')
        self.status_page_title = _('Restore Forms Status')
        self.progress_text = _('Restoring your forms, this may take some time...')
        self.complete_short = _('Restore complete!')
        self.success_text = _('Successfully restored ')
        self.fail_text = _('Restore Failed. Details:')
        self.error_text = _('Problem restoring your forms! Please try again or report an issue')
        self.help_message = _('To archive back any forms, use the Manage Forms report and filter to Normal forms')
    else:
        self.mode_name = self.ARCHIVE_MODE
        self.xform_filter = ADD_TO_ES_FILTER['forms']
        self.button_text = _('Archive selected forms')
        self.button_class = _('btn-danger')
        self.status_page_title = _('Archive Forms Status')
        self.progress_text = _('Archiving your forms, this may take some time...')
        self.complete_short = _('Archive complete!')
        self.success_text = _('Successfully archived ')
        self.fail_text = _('Archive Failed. Details:')
        self.error_text = _('Problem archiving your forms! Please try again or report an issue')
        self.help_message = _('To restore any archived forms, use the Manage Forms report and filter to Archived forms')
    if validate:
        self.validate_mode(mode)

dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/data_interfaces/interfaces.py FormManagementMode.__init__/original