summaryrefslogtreecommitdiffstats
path: root/xf86config.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2000-02-15 03:57:59 +0000
committerMatt Wilson <msw@redhat.com>2000-02-15 03:57:59 +0000
commitb8b2999adc91dbdb8f75ad8e8c95035eca6a0087 (patch)
tree98c494fb4e9dbe5a4281bc0debd64e2d94db2859 /xf86config.py
parent9b8d81c377e12258553fd85a7fbac38b01819a8a (diff)
downloadanaconda-b8b2999adc91dbdb8f75ad8e8c95035eca6a0087.tar.gz
anaconda-b8b2999adc91dbdb8f75ad8e8c95035eca6a0087.tar.xz
anaconda-b8b2999adc91dbdb8f75ad8e8c95035eca6a0087.zip
consult monitor db for ddc matches
Diffstat (limited to 'xf86config.py')
-rw-r--r--xf86config.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/xf86config.py b/xf86config.py
index b40f9b794..b7a1cde27 100644
--- a/xf86config.py
+++ b/xf86config.py
@@ -42,6 +42,8 @@ class XF86Config:
self.keyLayout = kbd.layout
self.keyVariant = ""
self.keyOptions = ""
+ self.monlist = {}
+ self.monids = {}
def setKeyboard (self, rules, model, layout, variant, options):
self.keyRules = rules
@@ -126,7 +128,8 @@ class XF86Config:
return cards
def monitors (self, lines = None):
- monitors = {}
+ if self.monlist:
+ return self.monlist
if not lines:
db = open ('/usr/X11R6/share/Xconfigurator/MonitorsDB')
lines = db.readlines ()
@@ -144,11 +147,12 @@ class XF86Config:
eisa = string.strip(fields[2])
vert = string.strip(fields[3])
horiz = string.strip(fields[4])
- if monitors.has_key(man):
- monitors[man].append((model, eisa, vert, horiz))
+ if self.monlist.has_key(man):
+ self.monlist[man].append((model, eisa, vert, horiz))
else:
- monitors[man] = [(model, eisa, vert, horiz)]
- return monitors
+ self.monlist[man] = [(model, eisa, vert, horiz)]
+ self.monids[eisa] = (man, model, eisa, vert, horiz)
+ return self.monlist
def setMonitor (self, (monitor, (hrange, vrange))):
self.monName = monitor
@@ -196,6 +200,7 @@ class XF86Config:
# VESA probe for monitor/videoram, etc.
if probeMonitor:
+ self.monitors()
try:
probe = string.split (iutil.execWithCapture ("/usr/sbin/ddcprobe", ['ddcprobe']), '\n')
for line in probe:
@@ -221,6 +226,15 @@ class XF86Config:
if self.vidCards and self.cardMan:
self.vidCards[self.primary]["VENDOR"] = self.cardMan
+ if self.monEisa:
+ # read the monitor DB
+ self.monitors()
+ if self.monids.has_key (self.monEisa):
+ (man, model, eisa, vert, horiz) = self.monids[self.monEisa]
+ self.monName = model
+ self.monID = model
+ self.monHoriz = horiz
+ self.monVert = vert
except:
pass
if not self.vidRam and self.device: