summaryrefslogtreecommitdiffstats
path: root/xf86config.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-09-21 03:45:36 +0000
committerMatt Wilson <msw@redhat.com>1999-09-21 03:45:36 +0000
commitef28da7ac043a3817958446491f125437f95c2e4 (patch)
tree902e3e47120ab8e494137e90cfa3e44a8a3269d3 /xf86config.py
parent746429b659022d210f20642b4197e836b6455c7e (diff)
downloadanaconda-ef28da7ac043a3817958446491f125437f95c2e4.tar.gz
anaconda-ef28da7ac043a3817958446491f125437f95c2e4.tar.xz
anaconda-ef28da7ac043a3817958446491f125437f95c2e4.zip
x improvements
Diffstat (limited to 'xf86config.py')
-rw-r--r--xf86config.py30
1 files changed, 25 insertions, 5 deletions
diff --git a/xf86config.py b/xf86config.py
index b7f554d5e..acec276cc 100644
--- a/xf86config.py
+++ b/xf86config.py
@@ -50,6 +50,21 @@ class XF86Config:
self.mouse = { "mouseDev" : "/dev/mouse",
"mouseProto" : "PS/2" }
+ def areaCompare (self, first, second):
+ (sx1, sy1) = string.split (first, 'x')
+ (sx2, sy2) = string.split (second, 'x')
+
+ x1 = string.atoi (sx1)
+ y1 = string.atoi (sy1)
+ x2 = string.atoi (sx2)
+ y2 = string.atoi (sy2)
+
+ if ((x1 * y1) > (x2 * y2)):
+ return -1
+ elif ((x1 * y1) < (x2 * y2)):
+ return 1
+ return 0
+
def filterModesByMemory (self):
if not self.vidRam:
return
@@ -710,6 +725,10 @@ Section "Device"
def screenSection (self):
info = { "DEVICE" : self.devID,
"MONITOR" : self.monID }
+
+ for (depth, modes) in self.modes.items ():
+ modes.sort (self.areaCompare)
+
section = """
# **********************************************************************
# Screen section
@@ -776,14 +795,15 @@ if __name__ == "__main__":
sys.path.append ("kudzu")
x = XF86Config ()
print x.cards ("ATI Mach64 3D RAGE II")
-# x.probe ()
- sys.exit (0)
+ x.probe ()
+# sys.exit (0)
+ x.filterModesByMemory ()
print x.preludeSection ()
print x.keyboardSection ()
print x.mouseSection ()
print x.monitorSection ()
print x.deviceSection ()
- x.modes["8"] = [ "640x480" ]
- x.modes["16"] = [ "640x480" ]
- x.modes["32"] = [ "640x480" ]
+# x.modes["8"] = [ "640x480" ]
+# x.modes["16"] = [ "640x480" ]
+# x.modes["32"] = [ "640x480" ]
print x.screenSection ()