|
|
|
@ -62,17 +62,18 @@ class VariableOsX11Resolution(Variable):
|
|
|
|
|
if self.Get('os_root_type') != 'usb-hdd':
|
|
|
|
|
xlog = "/var/log/Xorg.0.log"
|
|
|
|
|
if os.access(xlog, os.R_OK):
|
|
|
|
|
reXorgLogParser = re.compile(
|
|
|
|
|
logdata = open(xlog, 'r').read()
|
|
|
|
|
for re_pat in (
|
|
|
|
|
"Output [\S]+ using initial mode (\d+)x(\d+)",
|
|
|
|
|
"Virtual screen size determined to be"
|
|
|
|
|
" ([0-9]+)\s*x\s*([0-9]+)|"
|
|
|
|
|
'Setting mode "(\d+)x(\d+)[0-9@]"|'
|
|
|
|
|
"Output [\S]+ using initial mode (\d+)x(\d+)|"
|
|
|
|
|
"Virtual size is (\d+)x(\d+)", re.S)
|
|
|
|
|
resXorgLogParser = reXorgLogParser.search(
|
|
|
|
|
open(xlog, 'r').read())
|
|
|
|
|
if resXorgLogParser:
|
|
|
|
|
return "%sx%s" % filter(lambda x: x,
|
|
|
|
|
resXorgLogParser.groups())[:2]
|
|
|
|
|
" ([0-9]+)\s*x\s*([0-9]+)",
|
|
|
|
|
'Setting mode "(\d+)x(\d+)[0-9@]"',
|
|
|
|
|
"Virtual size is (\d+)x(\d+)"):
|
|
|
|
|
reXorgLogParser = re.compile(re_pat, re.S)
|
|
|
|
|
resXorgLogParser = reXorgLogParser.search(logdata)
|
|
|
|
|
if resXorgLogParser:
|
|
|
|
|
return "%sx%s" % filter(lambda x: x,
|
|
|
|
|
resXorgLogParser.groups())[:2]
|
|
|
|
|
|
|
|
|
|
# get resolution from xorg.conf
|
|
|
|
|
xorgconf = "/etc/X11/xorg.conf"
|
|
|
|
|