~ubuntu-branches/ubuntu/utopic/mythbuntu-common/utopic-proposed

« back to all changes in this revision

Viewing changes to mythbuntu_common/vnc.py

  • Committer: Package Import Robot
  • Author(s): Alberto Milone
  • Date: 2012-06-08 16:44:49 UTC
  • Revision ID: package-import@ubuntu.com-20120608164449-b96g03486207oh3d
Tags: 0.68
* debian/control:
  - Depend on python-xkit (>= 0.5.0).
* mythbuntu_common/vnc.py:
  - Add support for the new python-xkit API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
import pexpect
27
27
 
28
28
#import xorgconfig
29
 
import XKit
30
 
from XKit import xutils
 
29
import xkit
 
30
from xkit import xutils
31
31
 
32
32
#Script Directory
33
33
SCRIPTDIR = '/usr/share/mythbuntu-common/scripts'
44
44
        
45
45
        try:
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()
49
49
 
50
50
    def create_password(self,password):
76
76
              
77
77
        if have_modules:
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)
80
80
        
81
81
        if have_screens:
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)
84
84
        
85
85
 
86
86
        #Now re-enable if we want to
87
87
        if enable:
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)
93
93
            
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)
98
98
        
99
 
        self.xorg_conf.writeFile(self.root + self.xorg_conf_path)
 
99
        self.xorg_conf.write(self.root + self.xorg_conf_path)
100
100