[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [master 2/2] text: remove the needless complexity in the screen switching loop.



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/14/2010 05:24 AM, Ales Kozumplik wrote:
> This has been possible since a3570474c83aea26477b9826e1201b4d68e9476a, notice that now there is always exactly one class per interactive TUI step.
> ---
>  pyanaconda/text.py |   92 +++++++++++++++++-----------------------------------
>  1 files changed, 30 insertions(+), 62 deletions(-)


> +	    (file, className) = stepToClasses[step]
> +            while 1:

Looks like there is an indent problem here, and a tab in the 1st line.


> +                try:
> +                    found = imp.find_module(file, textw.__path__)
> +                    moduleName = 'pyanaconda.textw.%s' % file
> +                    loaded = imp.load_module(moduleName, *found)
> +                    nextWindow = loaded.__dict__[className]
> +                    break
> +                except ImportError as e:
> +                    rc = ButtonChoiceWindow(self.screen, _("Error!"),
> +                                      _("An error occurred when attempting "
> +                                        "to load an installer interface "
> +                                        "component.\n\nclassName = %s")
> +                                      % className,
> +                                      buttons=[_("Exit"), _("Retry")])
> +
> +                    if rc == string.lower(_("Exit")):
> +                        sys.exit(0)
> +
> +            win = nextWindow()
> +            rc = win(self.screen, instance)
> +
> +            if rc in [INSTALL_OK, INSTALL_NOOP]:
> +                anaconda.dispatch.gotoNext()
> +            elif rc == INSTALL_BACK:
>                  if anaconda.dispatch.canGoBack():
>                      anaconda.dispatch.gotoPrev()
>                  else:
> @@ -546,10 +517,7 @@ class InstallInterface(InstallInterfaceBase):
>                                           "from here. You will have to try "
>                                           "again."),
>                                         buttons=[_("OK")])
> -	    else:
> -		anaconda.dispatch.gotoNext()
> -
> -	    (step, args) = anaconda.dispatch.currentStep()
> +            (step, instance) = anaconda.dispatch.currentStep()
>  
>          self.screen.finish()
>  

Hard to tell, but there may be an indent problem there.

Ack otherwise. Looks alot cleaner.

- -- 
Brian C. Lane <bcl redhat com>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEVAwUBTD3j7RF+jBaO/jp/AQJgSgf+IYMBxL0zRKkq0KoeCvLyAqhhuKqss1sW
ERhEXA/nMnzHModuMq9kT9/Q7iLs9J34zIacC7OwikwPQc2mHExvqNe4Ys76GQvi
kE9LX43TS+5+3tNBTDTl0q1G5g4lDnEar4+Kqgbqafezyp5YqByiv5FjjvK33Ecb
/pba0wZwV805x53oKzaR02VAfPLrROiGRL549RycdaJ3DgRORLejMglXpGHbmAOz
cMnJQ+QdU30CblbdORSgzaq0TI1Htt8A4Xy0Ia6lihOOnK22+5WsMDPL0hD6vPyU
rc3TvdL03MfvA0L1MlMyVUZncEaUqLyM4Ouj0C2dvxu6NRsvYgMecg==
=qN3O
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]