Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUdev pygobject migration #5

Merged
merged 3 commits into from
Aug 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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