further mouse extermination

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Coming out of some of the rhpxl de-kudzu discussions, this patchset gets rid 
of even more of the pesky mouse infestation.

Bill
diff --git a/anaconda b/anaconda
index d844036..295a3ef 100755
--- a/anaconda
+++ b/anaconda
@@ -453,8 +453,7 @@ def probeHW(opts, x_already_set, xserver):
         # Probe what is available for X and setup a hardware state
         #
         # try to probe interesting hw
-        skipmouseprobe = not (not os.environ.has_key('DISPLAY') or flags.setupFilesystems)
-        xserver.probeHW(skipMouseProbe=skipmouseprobe, forceDriver=opts.xdriver)
+        xserver.probeHW(forceDriver=opts.xdriver)
 
         # if the len(videocards) is zero, then let's assume we're isHeadless
         if len(xserver.videohw.videocards) == 0:
@@ -940,9 +939,6 @@ if __name__ == "__main__":
     anaconda.id.x_already_set = x_already_set
 
     if xserver:
-        if xserver.mousehw:
-            anaconda.id.setMouse(xserver.mousehw)
-
         if xserver.videohw:
             anaconda.id.setVideoCard(xserver.videohw)
 
diff --git a/installclass.py b/installclass.py
index 3c4af11..6dbf8d5 100644
--- a/installclass.py
+++ b/installclass.py
@@ -414,15 +414,6 @@ class BaseInstallClass(object):
             rl = 3
         self.setMiscXSettings(id, depth, resolution, runlevel = rl)
 
-    def setMouse(self, id, mouseType, device = None, emulThree = -1):
-        import rhpxl.mouse as mouse
-
-        # blindly trust what we're told
-        mouse = mouse.Mouse(skipProbe = 1)
-        mouseName = mouse.mouseToMouse()[mouseType]
-        mouse.set(mouseName, emulThree, device)
-        id.setMouse(mouse)
-
     def getBackend(self, methodstr):
         # this should be overriden in distro install classes
         from backend import AnacondaBackend
@@ -463,7 +454,6 @@ class BaseInstallClass(object):
 	#id.setAuthentication()
 	#id.setHostname()
 	#id.setDesktop()
-	#id.setMouse()
 
 	# These are callbacks used to let classes configure packages
 	#id.setPackageSelection()
diff --git a/instdata.py b/instdata.py
index 32c5124..d66757f 100644
--- a/instdata.py
+++ b/instdata.py
@@ -58,7 +58,6 @@ class InstallData:
     def reset(self):
 	# Reset everything except: 
 	#
-	#	- The mouse
 	#	- The install language
 	#	- The keyboard
 
@@ -117,10 +116,6 @@ class InstallData:
     def setKeyboard(self, keyboard):
         self.keyboard = keyboard
 
-    # expects a Mouse object
-    def setMouse(self, mouse):
-        self.mouse = mouse
-
     # expects a VideoCardInfo object
     def setVideoCard(self, video):
         self.videocard = video
@@ -301,7 +296,6 @@ class InstallData:
         self.backend = backend
         self.anaconda = anaconda
 
-        self.mouse = None
         self.monitor = None
         self.videocard = None
         self.xsetup = None
diff --git a/packages.py b/packages.py
index a6a8a15..50c6a37 100644
--- a/packages.py
+++ b/packages.py
@@ -119,7 +119,7 @@ def writeXConfiguration(anaconda):
     else:
         fn = "/tmp/"
 
-    anaconda.id.xsetup.write(fn+"/etc/X11", anaconda.id.mouse, anaconda.id.keyboard)
+    anaconda.id.xsetup.write(fn+"/etc/X11", anaconda.id.keyboard)
     anaconda.id.desktop.write(anaconda.rootPath)
 
 def doMigrateFilesystems(anaconda):
diff --git a/xsetup.py b/xsetup.py
index 13fdb42..60d1593 100644
--- a/xsetup.py
+++ b/xsetup.py
@@ -32,9 +32,8 @@ class XSetup:
 	self.xserver = xserver
         self.anaconda = anaconda
 
-    def write(self, fn, mouse, keyboard):
+    def write(self, fn, keyboard):
         self.xserver.keyboard = keyboard
-        self.xserver.mousehw = mouse
         self.xserver.generateConfig()
 
         if self.anaconda.isKickstart:
diff --git a/src/xconf.py b/src/xconf.py
index 40c7d42..89e3c06 100755
--- a/src/xconf.py
+++ b/src/xconf.py
@@ -32,7 +32,6 @@ import locale
 import rhpxl.monitor
 import rhpxl.videocard
 import rhpl.keyboard
-import rhpxl.mouse
 from rhpl.translate import _, N_,textdomain
 from rhpxl.xhwstate import *
 
@@ -329,9 +328,7 @@ while loop_count < len(card_list):
 
         keyboard = rhpl.keyboard.Keyboard()
 	keyboard.read()
-        mouse = rhpxl.mouse.Mouse()
-	mouse.read()
-        xconfig = hardware_state.generate_xconfig(mouse,keyboard)
+        xconfig = hardware_state.generate_xconfig(keyboard = keyboard)
 
     handle_set_commands(set_values, hardware_state)
 
diff --git a/rhpxl/mouse.py b/rhpxl/mouse.py
deleted file mode 100644
index a99c4e9..0000000
--- a/rhpxl/mouse.py
+++ /dev/null
@@ -1,255 +0,0 @@
-# mouse.py: mouse configuration data
-#
-# Copyright 1999-2008 Red Hat, Inc.
-#
-# This software may be freely redistributed under the terms of the GNU
-# library public license.
-#
-# You should have received a copy of the GNU Library Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-# effective API:
-# .Mouse()
-# .read()
-# .mouseToMouse()
-# .set()
-
-from rhpl.simpleconfig import SimpleConfigFile
-import os
-import rhpl.translate as translate
-from rhpl.translate import _, N_
-import dbus
-
-translate.textdomain('rhpxl')
-
-class Mouse (SimpleConfigFile):
-    mouseModels = {
-        # (shortname: make, model, gpm protocol, X protocol, input protocol, device, emulate3)
-        "ascii": (N_("ASCII"), N_("MieMouse (serial)"),
-                  "ms3", "IntelliMouse", "ms3", "ttyS", 0),
-        "generic": (N_("Generic"), N_("2 Button Mouse (serial)"),
-                    "Microsoft", "Microsoft", "bare", "ttyS", 1),
-        "generic3": (N_("Generic"), N_("3 Button Mouse (serial)"),
-                     "Microsoft", "Microsoft", "ms", "ttyS", 0),
-        "genericps/2": (N_("Generic"), N_("2 Button Mouse (PS/2)"),
-                        "imps2", "IMPS/2", None, "input/mice", 1),
-        "generic3ps/2": (N_("Generic"), N_("3 Button Mouse (PS/2)"),
-                         "imps2", "IMPS/2", None, "input/mice", 0),
-        "genericwheelps/2": (N_("Generic"), N_("Wheel Mouse (PS/2)"),
-                             "imps2", "IMPS/2", None, "input/mice", 0),
-        "genericusb": (N_("Generic"), N_("2 Button Mouse (USB)"),
-                       "imps2", "IMPS/2", None, "input/mice", 1),
-        "generic3usb": (N_("Generic"), N_("3 Button Mouse (USB)"),
-                        "imps2", "IMPS/2", None, "input/mice", 0),
-        "genericwheelusb": (N_("Generic"), N_("Wheel Mouse (USB)"),
-                            "imps2", "IMPS/2", None, "input/mice", 0),
-        "geniusnm": (N_("Genius"), N_("NetMouse (serial)"),
-                     "ms3", "IntelliMouse", "ms3", "ttyS", 1),
-        "thinking": (N_("Kensington"), N_("Thinking Mouse (serial)"),
-                     "Microsoft", "ThinkingMouse", "bare", "ttyS", 1),
-        "logitech": (N_("Logitech"), N_("C7 Mouse (serial, old C7 type)"),
-                     "Logitech", "Logitech", "mman", "ttyS", 0),
-        "logitechcc": (N_("Logitech"), N_("CC Series (serial)"),
-                       "logim", "MouseMan", "mman", "ttyS", 0),
-        "logimman": (N_("Logitech"), N_("MouseMan/FirstMouse (serial)"),
-                     "MouseMan", "MouseMan", "mman", "ttyS", 0),
-        "logimman+": (N_("Logitech"), N_("MouseMan+/FirstMouse+ (serial)"),
-                      "pnp", "IntelliMouse", "ms3", "ttyS", 0),
-        "microsoft": (N_("Microsoft"), N_("Compatible Mouse (serial)"),
-                      "Microsoft", "Microsoft", "bare", "ttyS", 1), 
-        "msnew": (N_("Microsoft"), N_("Rev 2.1A or higher (serial)"),
-                  "pnp", "Auto", "ms", "ttyS", 1), 
-        "msintelli": (N_("Microsoft"), N_("IntelliMouse (serial)"),
-                      "ms3", "IntelliMouse", "ms3", "ttyS", 0),
-        "mousesystems": (N_("Mouse Systems"), N_("Mouse (serial)"),
-                         "MouseSystems", "MouseSystems", "msc", "ttyS", 1),
-        "mmseries": (N_("MM"), N_("MM Series (serial)"),
-                     "MMSeries", "MMSeries", "bare", "ttyS", 1),
-        "mmhittab": (N_("MM"), N_("MM HitTablet (serial)"),
-                     "MMHitTab", "MMHittab", "bare", "ttyS", 1),
-        "none": ("No", "mouse" , "none", "none", None, None, 0),
-        "sun": (N_("Sun"), N_("Mouse"), "sun", "sun", "sun", "sunmouse", 0),
-        "synaptics": (N_("Synaptics"), N_("Synaptics Touchpad"), 
-                      "imps2", "IMPS/2", None, "input/mice", 1),
-        "vmmouse": (N_("VMWare"), N_("VMWare Mouse"), 
-                      "vmmouse", "vmmouse", None, "input/mice", 1),
-	}
-
-    # note that mice is deprecated; things shouldn't be accessing it directly
-    # but, to keep things simpler for now, we'll keep it around
-    mice = {}
-    for (key, val) in mouseModels.items():
-        shortname = key
-        try:
-            (make, model, gpmproto, xproto, iproto, device, emulate3) = val
-        except Exception, e:
-            continue
-	newkey = "%s - %s" % (make, model)
-        mice[newkey] = (gpmproto, xproto, iproto, device, emulate3, shortname)
-    
-    
-    def mouseToMouse(self):
-        types = {}
-        for (type, val) in self.mouseModels.items():
-            (make, model, gpmproto, xproto, iproto, device, emulate3) = val
-            types[type] = "%s - %s" % (make, model)
-        return types
-        
-
-    # XXX fixme - externalize
-    def __init__ (self, skipProbe = 0):
-        self.info = {}
-        self.device = None
-        self.mousetype = None
-        self.emulate = 0
-        self.setMouse ("generic3ps/2")
-	self.wasProbed = 0
-	self.probedList = None
-
-	if not skipProbe:
-	    self.probe()
-
-        self.orig_mouse = self.get()
-
-    def get_Orig(self):
-        return self.orig_mouse
-        
-    def probed(self):
-	return self.wasProbed
-
-    def getAllProbed(self):
-	return self.probedList
-
-    def anyUSBMice(self):
-	# first check current configured mouse
-	if self.device == "input/mice":
-	    return 1
-	
-	# now check all probed mice
-	if not self.probedList:
-	    return 0
-	
-	for l in self.probedList:
-	    (device, module, desc) = l
-	    if device == "input/mice":
-		return 1
-
-	return 0
-    
-    def probe (self, frob = 0):
-	try:
-	    bus = dbus.SystemBus()
-	    hal = dbus.Interface(bus.get_object('org.freedesktop.Hal',
-						'/org/freedesktop/Hal/Manager'),
-				 'org.freedesktop.Hal.Manager')
-	    list = hal.FindDeviceByCapability('input.mouse')
-	except:
-	    list = None
-
-        if (list):
-	    l = list[0]
-	    self.setMouse("generic3ps/2")
-            self.device = "input/mice"
-	    self.wasProbed = 1
-            return 1
-        else:
-            self.setMouse("none")
-	    self.device = None
-	    self.wasProbed = 0
-            return 0
-    
-    def available (self):
-        return self.mice
-
-    def get (self):
-	return (self.info ["FULLNAME"], self.emulate)
-
-    def getMouse (self):
-        return (self.mousetype, self.emulate)
-
-    def __str__(self):
-	if (self.emulate):
-	    self.info["XEMU3"] = "yes"
-	else:
-	    self.info["XEMU3"] = "no"
-	return SimpleConfigFile.__str__(self)
-
-    def makeLink(self, root):
-	try:
-	    os.unlink(root + "/dev/mouse")
-	except:
-	    pass
-	if (self.device):
-	    os.symlink(self.device, root + "/dev/mouse")
-
-    def getDevice(self):
-	return self.device
-
-    def shortDescription(self):
-        if self.info.has_key("FULLNAME"):
-            return self.info["FULLNAME"]
-        else:
-            return _("Unable to probe")
-
-    def setDevice(self, device):
-	self.device = device
-
-    def set (self, mouse = None, emulateThreeButtons = -1, thedev = None):
-        (gpm, x11, inp, dev, em, shortname) = self.mice[mouse]
-        self.setMouse(shortname, emulateThreeButtons, thedev)
-
-    def setMouse (self, shortname, emul = -1, thedev = None):
-        (make, model, gpm, x11, inp, dev, em) = self.mouseModels[shortname]
-        mouse = "%s - %s" % (make, model)
-
-        emulateThreeButtons = emul
-
-        self.mousetype = shortname
-        self.info["MOUSETYPE"] = gpm
-        self.info["XMOUSETYPE"] = x11
-	if inp:
-	    self.info["IMOUSETYPE"] = inp
-        self.info["FULLNAME"] = mouse
-        if emulateThreeButtons != -1:
-            self.emulate = emulateThreeButtons
-        else:
-            self.emulate = em
-        if thedev:
-            self.device = thedev
-	if not self.device:
-            self.device = dev
-
-    def read(self, instPath = "/"):
-        SimpleConfigFile.read(self, instPath + "/etc/sysconfig/mouse")
-        self.beenset = 1
-
-    def write(self, instPath):
-        if self.info["FULLNAME"] == "None - None":
-            return
-	f = open(instPath + "/etc/sysconfig/mouse", "w")
-	f.write(str (self))
-	f.close()
-	self.makeLink(instPath)
-
-
-    def writeKS(self, f):
-        f.write("mouse")
-
-        for arg in self.getArgList():
-            f.write(" " + arg)
-        f.write("\n")
-
-
-    def getArgList(self):
-        args = []
-
-        if self.info["FULLNAME"]:
-            mouseName = self.info["FULLNAME"]
-            args.append(self.mice[mouseName][4])
-        if self.device:
-            args.append("--device %s" %(self.device))
-        if self.emulate:
-            args.append("--emulthree")
-        
-        return args
diff --git a/rhpxl/xserver.py b/rhpxl/xserver.py
index 2aa39d1..8aa4486 100644
--- a/rhpxl/xserver.py
+++ b/rhpxl/xserver.py
@@ -45,7 +45,6 @@ class XServer:
         self.keyboard = None
         self.logfile = "/dev/null"
         self.monitorhw = None
-        self.mousehw = None
         self.resolution = "800x600"
         self.root = "/"
         self.serverflags = ["vt6", "-config", "/tmp/XConfig.test",
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux