Package up2date_client :: Module rhnregGui
[hide private]
[frames] | no frames]

Module rhnregGui

source code

Explanation of the RHN registration gui and how it is used from both rhn_register and firstboot (from alikins): Most of the "work" happens in rhnregGui.py. Thats where the logic for the screens is. gui.py has Gui which is the big monster class (using druid) that makes up the main gui wizard for up2date/rhn_register. Gui implements showing the pages for up2date/rhn_register. For up2date/rhnreg, it has methods that load the classes from rhnregGui (by multiple inheritance...), but it's not too bad, it's all mixin stuff, nothing wacky, no overridden methods or anything. firstboot/* does more or less the same thing, but with a different style of wrapper just to present the firstboot style api's. (Each "page" in firstboot is a module with a class that inherits FirstBootGuiWindow.)

Classes [hide private]
  ReviewLog
  StartPage
There is a section of this page which asks if the user wants to register, which will only be shown in firstboot.
  ChooseServerPage
  LoginPage
  ReviewSubscriptionPage
  ConfirmAllUpdatesDialog
  ChooseChannelPage
  CreateProfilePage
  ProvideCertificatePage
  FinishPage
The finish screen.
  AlreadyRegisteredDialog
  AlreadyRegisteredSubscriptionManagerDialog
Window with text: You are already subscribed using subscription manager.
  ConfirmQuitDialog
  MoreInfoDialog
  WhyRegisterDialog
  HardwareDialog
  PackageDialog
  NetworkConfigDialog
This is the dialog that allows setting http proxy settings.
Functions [hide private]
 
errorWindow(message) source code
 
unexpectedError(message, exc_info=None)
Shows an error dialog with the message and logs that an error happened.
source code
 
callAndFilterExceptions(function, allowedExceptions, disallowedExceptionMessage, errorHandler=unexpectedError)
Calls function and limits the exceptions that can be raised to those in the list provided and SystemExit.
source code
 
hasBaseChannelAndUpdates()
Returns a bool indicating whether the system has registered, subscribed to a base channel, and has at least update entitlements.
source code
 
setBusyCursor()
Dummy function that will be overidden by rhn_register's standalone gui and firstboot in different ways.
source code
 
setArrowCursor()
Dummy function that will be overidden by rhn_register's standalone gui and firstboot in different ways.
source code
Variables [hide private]
  t = gettext.translation('rhn-client-tools', fallback= True)
  _ = t.ugettext
  cfg = config.initUp2dateConfig()
  log = up2dateLog.initLog()
  gladefile = "/usr/share/rhn/up2date_client/rh_register.glade"
  username = None
hash(x)
  password = None
hash(x)
  productInfo = None
hash(x)
  hw_activation_code = None
hash(x)
  serverType = None
hash(x)
  chosen_channel = None
hash(x)
  _hasBaseChannelAndUpdates = False
  _autoActivatedNumbers = False
  reviewLog = ReviewLog()
Function Details [hide private]

unexpectedError(message, exc_info=None)

source code 
Shows an error dialog with the message and logs that an error happened.

This function is designed to be used in an except block like so:
    unexpectedError(_("Your error here."), sys.exc_info())

callAndFilterExceptions(function, allowedExceptions, disallowedExceptionMessage, errorHandler=unexpectedError)

source code 

Calls function and limits the exceptions that can be raised to those in the list provided and SystemExit. If an exception is raised which isn't allowed, errorHandler will be called and then None will be returned. errorHandler defaults to the unexpectedError function and will be passed disallowedExceptionMessage. If it is overridden, the function provided must take a string and a tuple (see below for details). If no exceptions are raised, functions's return value is returned.

I need this function because if some of the functions in the Pages raise unexpected exceptions, the druid might advance when it shouldn't or go to the wrong page. I think it's shorter and more readable to factor this out rather than have similar functionality in all those functions.

hasBaseChannelAndUpdates()

source code 

Returns a bool indicating whether the system has registered, subscribed to a base channel, and has at least update entitlements. Uses information from the most recent time the create profile screen was run through.