Пример #1
0
 def default(self, index=1):
     from subiquity.ui.views.refresh import RefreshView
     if self.updated:
         raise Skip()
     show = False
     if index == 1:
         if self.check_state == CheckState.AVAILABLE:
             show = True
             self.offered_first_time = True
     elif index == 2:
         if not self.offered_first_time:
             if self.check_state in [
                     CheckState.AVAILABLE, CheckState.CHECKING
             ]:
                 show = True
     else:
         raise AssertionError("unexpected index {}".format(index))
     if show:
         self.view = RefreshView(self)
         self.ui.set_body(self.view)
         if 'update' in self.answers:
             if self.answers['update']:
                 self.view.update()
             else:
                 self.done()
     else:
         raise Skip()
Пример #2
0
 def make_ui(self, index=1):
     if self.app.updated:
         raise Skip()
     show = False
     if index == 1:
         if self.status.availability == RefreshCheckState.AVAILABLE:
             show = True
             self.offered_first_time = True
     elif index == 2:
         if not self.offered_first_time:
             if self.status.availability in [
                     RefreshCheckState.UNKNOWN, RefreshCheckState.AVAILABLE
             ]:
                 show = True
     else:
         raise AssertionError("unexpected index {}".format(index))
     if show:
         return RefreshView(self)
     else:
         raise Skip()
Пример #3
0
 def start_ui(self, index=1):
     from subiquity.ui.views.refresh import RefreshView
     if self.app.updated:
         raise Skip()
     show = False
     if index == 1:
         if self.check_state == CheckState.AVAILABLE:
             show = True
             self.offered_first_time = True
     elif index == 2:
         if not self.offered_first_time:
             if self.check_state in [
                     CheckState.UNKNOWN, CheckState.AVAILABLE
             ]:
                 show = True
     else:
         raise AssertionError("unexpected index {}".format(index))
     if show:
         self.ui.set_body(RefreshView(self))
     else:
         raise Skip()