Permalink
Browse files

GUdev pygobject migration

  • Loading branch information...
javihernandez committed Apr 6, 2012
1 parent fb44481 commit 521f84ba2a5ea806ab6dd10ad5b1dae64fbfaa29
Showing with 9 additions and 9 deletions.
  1. +5 −5 udevdiscover/device/__init__.py
  2. +4 −4 udevdiscover/devicefinder.py
@@ -22,7 +22,7 @@
# Authors : J. Félix Ontañón <fontanon@emergya.es>
#
import gudev
from gi.repository import GUdev
def match_string(device, search_string):
""" Finds the search string around the device """
@@ -133,15 +133,15 @@ class Device(object):
DEFAULT_ICON = 'dialog-question'
UNKNOWN_DEV = 'Unknown Device'
DEVICE_TYPE_STR = {gudev.DEVICE_TYPE_BLOCK: 'block',
gudev.DEVICE_TYPE_CHAR: 'char',
gudev.DEVICE_TYPE_NONE: 'n/a'
DEVICE_TYPE_STR = {GUdev.DeviceType.BLOCK: 'block',
GUdev.DeviceType.CHAR: 'char',
GUdev.DeviceType.NONE: 'n/a'
}
def __init__(self, device):
'''Create a new input device
@type device: gudev.Device
@type device: GUdev.Device
@param device: The device we are using
'''
self.device = device
@@ -23,11 +23,11 @@
#
from gi.repository import GObject
import gudev
from gi.repository import GUdev
import device
def get_subsystems():
client = gudev.Client('')
client = GUdev.Client()
subsys = []
for device in client.query_by_subsystem('*'):
@@ -59,7 +59,7 @@ def __init__(self, subsystems='', parent_tree=False):
'''
GObject.GObject.__init__(self)
self.client = gudev.Client(subsystems)
self.client = GUdev.Client()
self.subsystems = subsystems
self.parent_tree = parent_tree
self.devices_tree = {}
@@ -68,7 +68,7 @@ def __init__(self, subsystems='', parent_tree=False):
self.client.connect('uevent', self.event)
def scan_subsystems(self, subsystems='', parent_tree=False):
self.client = gudev.Client(subsystems)
self.client = GUdev.Client()
self.subsystems = subsystems
self.devices_tree = {}
self.devices_list = []

0 comments on commit 521f84b

Please sign in to comment.