import xorgconfig

xconfig = xorgconfig.readConfig("/etc/X11/xorg.conf")

for screensection in xconfig.getSections("screen"):
    print screensection.identifier
    print screensection.option
    
for screensection in xconfig.getSections("device"):
    print screensection.option
    print screensection.option[1]
    print screensection.option[2]