46
46
self.xorg_conf = xutils.XUtils(self.xorg_conf_path)
47
except(IOError, XKit.xorgparser.ParseException):#if xorg.conf is missing or broken
47
except(IOError, xkit.xorgparser.ParseException):#if xorg.conf is missing or broken
48
48
self.xorg_conf = xutils.XUtils()
50
50
def create_password(self,password):
78
78
for m in self.add_modules:
79
self.xorg_conf.removeOption("Module", "Load", value=m, position=0)
79
self.xorg_conf.remove_option("Module", "Load", value=m, position=0)
82
82
for item in self.add_screen:
83
self.xorg_conf.removeOption("Screen", item[0], position=0)
83
self.xorg_conf.remove_option("Screen", item[0], position=0)
86
86
#Now re-enable if we want to
88
88
if self.add_modules:
89
89
if not have_modules:
90
self.xorg_conf.makeSection("Module")
90
self.xorg_conf.make_section("Module")
91
91
for m in self.add_modules:
92
self.xorg_conf.addOption("Module", "Load", m, position=0)
92
self.xorg_conf.add_option("Module", "Load", m, position=0)
94
94
if not have_screens:
95
self.xorg_conf.makeSection("Screen", identifier="Default Screen")
95
self.xorg_conf.make_section("Screen", identifier="Default Screen")
96
96
for item in self.add_screen:
97
self.xorg_conf.addOption("Screen", item[0], item[1], optiontype="Option", position=0)
97
self.xorg_conf.add_option("Screen", item[0], item[1], option_type="Option", position=0)
99
self.xorg_conf.writeFile(self.root + self.xorg_conf_path)
99
self.xorg_conf.write(self.root + self.xorg_conf_path)