[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH] Strip the network screen down to just setting the default hostname.
- From: Chris Lumens <clumens redhat com>
- To: anaconda-devel-list redhat com
- Cc:
- Subject: [PATCH] Strip the network screen down to just setting the default hostname.
- Date: Thu, 5 Feb 2009 13:27:41 -0500
---
textw/network_text.py | 57 ++----------------------------------------------
1 files changed, 3 insertions(+), 54 deletions(-)
diff --git a/textw/network_text.py b/textw/network_text.py
index c583128..f5f8eac 100644
--- a/textw/network_text.py
+++ b/textw/network_text.py
@@ -21,64 +21,13 @@
# Michael Fulbright <msf redhat com>
# David Cantrell <dcantrell redhat com>
#
-
-import string
-import network
-from snack import *
from constants_text import *
-from constants import *
-
-import gettext
-_ = lambda x: gettext.ldgettext("anaconda", x)
-
-import logging
-log = logging.getLogger("anaconda")
+import network
class HostnameWindow:
def __call__(self, screen, anaconda):
- toplevel = GridFormHelp(screen, _("Hostname"), "hostname", 1, 3)
- text = TextboxReflowed(55,
- _("Please name this computer. The hostname "
- "identifies the computer on a network."))
- toplevel.add(text, 0, 0, (0, 0, 0, 1))
-
- hostEntry = Entry(55)
- hostEntry.set(network.getDefaultHostname(anaconda))
- toplevel.add(hostEntry, 0, 1, padding = (0, 0, 0, 1))
-
- bb = ButtonBar(screen, (TEXT_OK_BUTTON, TEXT_BACK_BUTTON))
- toplevel.add(bb, 0, 2, growx = 1)
-
- while 1:
- result = toplevel.run()
- rc = bb.buttonPressed(result)
-
- if rc == TEXT_BACK_CHECK:
- screen.popWindow()
- return INSTALL_BACK
-
- hostname = string.strip(hostEntry.value())
- herrors = network.sanityCheckHostname(hostname)
-
- if not hostname:
- ButtonChoiceWindow(_("Error with Hostname"),
- _("You must enter a valid hostname for this "
- "computer."),
- buttons = [ _("OK") ])
- continue
-
- if herrors is not None:
- ButtonChoiceWindow(_("Error with Hostname"),
- _("The hostname \"%s\" is not valid for the "
- "following reason:\n\n%s")
- % (hostname, herrors,),
- buttons = [ _("OK") ])
- continue
-
- anaconda.id.network.hostname = hostname
- break
-
- screen.popWindow()
+ hname = network.getDefaultHostname(anaconda)
+ anaconda.id.network.hostname = hname
return INSTALL_OK
# vim:tw=78:ts=4:et:sw=4
--
1.6.0.3
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]