FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Kubuntu User

 
 
LinkBack Thread Tools
 
Old 07-14-2010, 12:24 PM
Ales Kozumplik
 
Default text: remove the needless complexity in the screen switching loop.

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(-)

diff --git a/pyanaconda/text.py b/pyanaconda/text.py
index 4dc0d18..f53f551 100644
--- a/pyanaconda/text.py
+++ b/pyanaconda/text.py
@@ -54,10 +54,10 @@ stepToClasses = {
"parttype" : ("partition_text", "PartitionTypeWindow"),
"addswap" : ("upgrade_text", "UpgradeSwapWindow"),
"upgrademigratefs" : ("upgrade_text", "UpgradeMigrateFSWindow"),
- "zfcpconfig": ("zfcp_text", ("ZFCPWindow")),
- "findinstall" : ("upgrade_text", ("UpgradeExamineWindow")),
+ "zfcpconfig": ("zfcp_text", "ZFCPWindow"),
+ "findinstall" : ("upgrade_text", "UpgradeExamineWindow"),
"upgbootloader": ("upgrade_bootloader_text", "UpgradeBootloaderWindow"),
- "network" : ("network_text", ("HostnameWindow")),
+ "network" : ("network_text", "HostnameWindow"),
"timezone" : ("timezone_text", "TimezoneWindow"),
"accounts" : ("userauth_text", "RootPasswordWindow"),
"tasksel": ("task_text", "TaskWindow"),
@@ -482,62 +482,33 @@ class InstallInterface(InstallInterfaceBase):
# draw the frame after setting up the fallback
self.drawFrame()

- lastrc = INSTALL_OK
- (step, instance) = anaconda.dispatch.currentStep()
+ (step, instance) = anaconda.dispatch.currentStep()
while step:
- (file, classNames) = stepToClasses[step]
-
- if type(classNames) != type(()):
- classNames = (classNames,)
-
- if lastrc == INSTALL_OK:
- step = 0
- else:
- step = len(classNames) - 1
-
- while step >= 0 and step < len(classNames):
- # reget the args. they could change (especially direction)
- (foo, args) = anaconda.dispatch.currentStep()
- nextWindow = None
-
- while 1:
- try:
- found = imp.find_module(file, textw.__path__)
- moduleName = 'pyanaconda.textw.%s' % file
- loaded = imp.load_module(moduleName, *found)
- nextWindow = loaded.__dict__[classNames[step]]
- break
- except ImportError as e:
- rc = ButtonChoiceWindow(self.screen, _("Error!"),
- _("An error occurred when attempting "
- "to load an installer interface "
- "component.

className = %s")
- % (classNames[step],),
- buttons=[_("Exit"), _("Retry")])
-
- if rc == string.lower(_("Exit")):
- sys.exit(0)
-
- win = nextWindow()
-
- #log.info("TUI running step %s (class %s, file %s)" %
- #(step, file, classNames))
-
- rc = win(self.screen, instance)
-
- if rc == INSTALL_NOOP:
- rc = lastrc
-
- if rc == INSTALL_BACK:
- step = step - 1
- anaconda.dispatch.dir = DISPATCH_BACK
- elif rc == INSTALL_OK:
- step = step + 1
- anaconda.dispatch.dir = DISPATCH_FORWARD
-
- lastrc = rc
-
- if step == -1:
+ (file, className) = stepToClasses[step]
+ while 1:
+ 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.

className = %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()

--
1.7.1.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-14-2010, 04:21 PM
"Brian C. Lane"
 
Default 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.

className = %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+Kqgbqafezyp5YqB yiv5FjjvK33Ecb
/pba0wZwV805x53oKzaR02VAfPLrROiGRL549RycdaJ3DgRORLe jMglXpGHbmAOz
cMnJQ+QdU30CblbdORSgzaq0TI1Htt8A4Xy0Ia6lihOOnK22+5 WsMDPL0hD6vPyU
rc3TvdL03MfvA0L1MlMyVUZncEaUqLyM4Ouj0C2dvxu6NRsvYg Mecg==
=qN3O
-----END PGP SIGNATURE-----

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-14-2010, 05:25 PM
Chris Lumens
 
Default text: remove the needless complexity in the screen switching loop.

> This has been possible since a3570474c83aea26477b9826e1201b4d68e9476a, notice that now there is always exactly one class per interactive TUI step.

This is a complicated one, and it's plenty easy to screw this stuff up.

Have you thoroughly tested by going back and forth in text mode?
Stepping forward several steps and then coming back to the first one?
Kickstart installs that are missing certain steps? Interactive
kickstart installs? Upgrades?

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-15-2010, 08:45 AM
Ales Kozumplik
 
Default text: remove the needless complexity in the screen switching loop.

On 07/14/2010 06:21 PM, Brian C. Lane wrote:

-----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.


The problem is just the tab: both lines have the correct indentation but
the first one already had a tab when I was modifying it (and I didn't
reindent it like the second line), so when the + is inserted in the
patch the tab gets squeezed in the first line but the spaces get shiften
in the second line.


Anyway, tab removed.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-15-2010, 09:21 AM
Ales Kozumplik
 
Default text: remove the needless complexity in the screen switching loop.

On 07/14/2010 07:25 PM, Chris Lumens wrote:

This has been possible since a3570474c83aea26477b9826e1201b4d68e9476a, notice that now there is always exactly one class per interactive TUI step.


This is a complicated one, and it's plenty easy to screw this stuff up.



I think all the old complexity was there only because it was possible to
have those 'substeps'.



Have you thoroughly tested by going back and forth in text mode?


Yes.


Stepping forward several steps and then coming back to the first one?


Yes.


Kickstart installs that are missing certain steps?


Yes.


Interactive
kickstart installs?


No, until yesterday I didn't know we had such a crazy feature but it's
going down isn't it?



Upgrades?


I tried just now and it says 'the root of the previously installed
system was not found' (even though I could boot Fedora from the machine
previously).


Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 07-16-2010, 02:29 PM
Chris Lumens
 
Default text: remove the needless complexity in the screen switching loop.

> >This is a complicated one, and it's plenty easy to screw this stuff up.
> >
>
> I think all the old complexity was there only because it was
> possible to have those 'substeps'.

Entirely possible.

> > Interactive
> >kickstart installs?
>
> No, until yesterday I didn't know we had such a crazy feature but
> it's going down isn't it?

Yes, yes it is. I wasn't sure about killing it until after responding
to you earlier.

In light of the testing, I say push it.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:59 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org