Esempio n. 1
0
    def refresh(self, args=None):
        NormalTUISpoke.refresh(self, args)

        self._container = ListRowContainer(1)

        log.debug("license found")
        # make the options aligned to the same column (the checkbox has the
        # '[ ]' prepended)
        self._container.add(
            TextWidget("%s\n" % _("Read the License Agreement")),
            self._show_license_screen_callback)

        self._container.add(
            CheckboxWidget(title=_("I accept the license agreement."),
                           completed=self.data.eula.agreed),
            self._license_accepted_callback)
        self.window.add_with_separator(self._container)
Esempio n. 2
0
    def initialize(self):
        log.debug("initializing the EULA spoke")
        NormalSpoke.initialize(self)

        self._have_eula = True
        self._eula_buffer = self.builder.get_object("eulaBuffer")
        self._agree_check_button = self.builder.get_object("agreeCheckButton")
        self._agree_label = self._agree_check_button.get_child()
        self._agree_text = self._agree_label.get_text()

        log.debug("looking for the license file")
        license_file = get_license_file_name()
        if not license_file:
            log.error("no license found")
            self._have_eula = False
            self._eula_buffer.set_text(
                _("No license found. Please report this "
                  "at http://bugzilla.redhat.com"))
            return

        self._eula_buffer.set_text("")
        itr = self._eula_buffer.get_iter_at_offset(0)
        log.debug("opening the license file")
        with open(license_file, "r") as fobj:
            # insert the first line without prefixing with space
            try:
                first_line = next(fobj)
            except StopIteration:
                # nothing in the file
                return
            self._eula_buffer.insert(itr, first_line.strip())

            # EULA file is preformatted for the console, we want to let Gtk
            # format it (blank lines should be preserved)
            for line in fobj:
                stripped_line = line.strip()
                if stripped_line:
                    self._eula_buffer.insert(itr, " " + stripped_line)
                else:
                    self._eula_buffer.insert(itr, "\n\n")
Esempio n. 3
0
 def status(self):
     return _("License accepted") if self.data.eula.agreed else _(
         "License not accepted")
Esempio n. 4
0
 def __init__(self, *args, **kwargs):
     NormalTUISpoke.__init__(self, *args, **kwargs)
     self.title = _("License information")
     self._container = None
Esempio n. 5
0
 def get_title():
     return _("LICENSING")
Esempio n. 6
0
    def status(self):
        if not self._have_eula:
            return _("No license found")

        return _("License accepted") if self.data.eula.agreed else _("License not accepted")