summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-04-29 19:15:22 +0000
committerErik Troan <ewt@redhat.com>1999-04-29 19:15:22 +0000
commit35d9f9b2058f6fe2f623bc58f3cf0081b5b599d9 (patch)
tree9798f744156c08951f52f9c55cf2627ff6c8cdd5
parentd6d2cdaa7615a2c6cbed7d7c8778e845236dbcb1 (diff)
downloadanaconda-35d9f9b2058f6fe2f623bc58f3cf0081b5b599d9.tar.gz
anaconda-35d9f9b2058f6fe2f623bc58f3cf0081b5b599d9.tar.xz
anaconda-35d9f9b2058f6fe2f623bc58f3cf0081b5b599d9.zip
use InstlalInterface class
-rwxr-xr-xanaconda11
-rwxr-xr-xgui.py2
-rw-r--r--text.py33
3 files changed, 26 insertions, 20 deletions
diff --git a/anaconda b/anaconda
index e11f4c6b2..8a3c5f5b3 100755
--- a/anaconda
+++ b/anaconda
@@ -46,11 +46,14 @@ if (mode == 'g' and not os.environ.has_key('DISPLAY')):
sys.exit(0)
if (mode == 'g'):
- import gui
- gui.run()
+ from gui import InstallMethod
elif (mode == 't'):
- import text
- text.run()
+ from text import InstallMethod
else:
print "No mode was specified"
+ sys.exit(1)
+
+method = InstallInterface()
+method.run()
+
diff --git a/gui.py b/gui.py
index 70f04451c..314f27711 100755
--- a/gui.py
+++ b/gui.py
@@ -125,7 +125,7 @@ class PartitionWindow:
window.destroy()
return self.rc
-class InstallMethod:
+class InstallInterface:
def run(self):
rc_parse("gtkrc")
diff --git a/text.py b/text.py
index 01f3c3351..ef9aa1aa3 100644
--- a/text.py
+++ b/text.py
@@ -1,21 +1,24 @@
import _balkan
from snack import *
+import rpm
-screen = SnackScreen()
+class InstallInterface:
+ def run(self):
+ screen = SnackScreen()
-device = 'hda';
-table = _balkan.readTable('/dev/' + device)
-partList = []
-for i in range(0, len(table) - 1):
- (type, start, size) = table[i]
- if (type == 0x83 and size):
- fullName = '/dev/%s%d' % (device, i + 1)
- partList.append((fullName, fullName))
-
-rc = ListboxChoiceWindow(screen, 'Root Partition', 'What partition would you '
- 'like to use for your root partition?', partList,
- buttons = ['Ok'])
+ device = 'hda';
+ table = _balkan.readTable('/dev/' + device)
+ partList = []
+ for i in range(0, len(table) - 1):
+ (type, start, size) = table[i]
+ if (type == 0x83 and size):
+ fullName = '/dev/%s%d' % (device, i + 1)
+ partList.append((fullName, fullName))
+
+ rc = ListboxChoiceWindow(screen, 'Root Partition', 'What partition would you '
+ 'like to use for your root partition?', partList,
+ buttons = ['Ok'])
-screen.finish()
+ screen.finish()
-print rc
+ print rc