Skip to content

Commit

Permalink
Merge pull request #5 from javihernandez/pygobject-migration
Browse files Browse the repository at this point in the history
GUdev pygobject migration
  • Loading branch information
fontanon committed Aug 9, 2014
2 parents fb44481 + d046d57 commit be77bf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions udevdiscover/device/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 """
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions udevdiscover/devicefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.new('')
subsys = []

for device in client.query_by_subsystem('*'):
Expand Down Expand Up @@ -59,7 +59,7 @@ def __init__(self, subsystems='', parent_tree=False):
'''
GObject.GObject.__init__(self)

self.client = gudev.Client(subsystems)
self.client = GUdev.Client.new(subsystems)
self.subsystems = subsystems
self.parent_tree = parent_tree
self.devices_tree = {}
Expand All @@ -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.new(subsystems)
self.subsystems = subsystems
self.devices_tree = {}
self.devices_list = []
Expand Down

0 comments on commit be77bf0

Please sign in to comment.