janitor: silence deprecated warnings

While running the app in flatpak, there are a few deprecation warnings
coming in:
PyGIDeprecationWarning: GObject.SIGNAL_RUN_FIRST is deprecated;
	use GObject.SignalFlags.RUN_FIRST instead
PyGIDeprecationWarning: GObject.property is deprecated;
	use GObject.Property instead
PyGIDeprecationWarning: GObject.MainLoop is deprecated;
	use GLib.MainLoop instead
This commit is contained in:
Benjamin Tissoires 2018-02-01 12:02:05 +01:00 committed by Peter Hutterer
parent b0284415ac
commit fc219e4c57
7 changed files with 29 additions and 29 deletions

View File

@ -270,7 +270,7 @@ class TuhiKeteDevice(_DBusObject):
class TuhiKeteManager(_DBusObject):
__gsignals__ = {
'pairable-device':
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
}
def __init__(self):

View File

@ -16,7 +16,7 @@ import enum
import logging
import sys
import time
from gi.repository import GObject
from gi.repository import GObject, GLib
from tuhi.dbusserver import TuhiDBusServer
from tuhi.ble import BlueZDeviceManager
@ -46,7 +46,7 @@ class TuhiDevice(GObject.Object):
# Signal sent when an error occurs on the device itself.
# Argument is a Wacom*Exception
'device-error':
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
}
BATTERY_UPDATE_MIN_INTERVAL = 300
@ -199,9 +199,9 @@ class TuhiDevice(GObject.Object):
class Tuhi(GObject.Object):
__gsignals__ = {
'device-added':
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
'device-connected':
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
}
def __init__(self):
@ -222,7 +222,7 @@ class Tuhi(GObject.Object):
self.devices = {}
self._search_stop_handler = None
self.mainloop = GObject.MainLoop()
self.mainloop = GLib.MainLoop()
def _on_tuhi_bus_name_acquired(self, dbus_server):
self.bluez.connect_to_bluez()

View File

@ -92,11 +92,11 @@ class BlueZDevice(GObject.Object):
'''
__gsignals__ = {
'connected':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
'disconnected':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
'updated':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
}
def __init__(self, om, obj):
@ -118,29 +118,29 @@ class BlueZDevice(GObject.Object):
if self.connected:
self.emit('connected')
@GObject.property
@GObject.Property
def name(self):
try:
return self.interface.get_cached_property('Name').unpack()
except AttributeError:
return 'UNKNOWN'
@GObject.property
@GObject.Property
def address(self):
return self.interface.get_cached_property('Address').unpack()
@GObject.property
@GObject.Property
def uuids(self):
return self.interface.get_cached_property('UUIDs').unpack()
@GObject.property
@GObject.Property
def vendor_id(self):
md = self.interface.get_cached_property('ManufacturerData')
if md is not None:
return md.keys()[0]
return None
@GObject.property
@GObject.Property
def connected(self):
return (self.interface.get_cached_property('Connected').unpack() and
self.interface.get_cached_property('ServicesResolved').unpack())
@ -274,13 +274,13 @@ class BlueZDeviceManager(GObject.Object):
'''
__gsignals__ = {
'device-added':
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT, GObject.TYPE_BOOLEAN)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT, GObject.TYPE_BOOLEAN)),
'device-updated':
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
'discovery-started':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
'discovery-stopped':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
}
def __init__(self, **kwargs):

View File

@ -40,7 +40,7 @@ class TuhiConfig(GObject.Object):
self._devices = {}
self._scan_config_dir()
@GObject.property
@GObject.Property
def devices(self):
'''
Returns a dictionary with the bluetooth address as key

View File

@ -135,7 +135,7 @@ class TuhiDBusDevice(_TuhiDBus):
'''
__gsignals__ = {
'pair-requested':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
}
def __init__(self, device, connection):
@ -361,18 +361,18 @@ class TuhiDBusServer(_TuhiDBus):
'''
__gsignals__ = {
'bus-name-acquired':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
'bus-name-lost':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
# Signal arguments:
# search_stop_handler(status)
# to be called when the search process has terminated, with
# an integer status code (0 == success, negative errno)
'search-start-requested':
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
'search-stop-requested':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
}
def __init__(self):

View File

@ -88,7 +88,7 @@ class Drawing(GObject.Object):
# The way we're building drawings, we don't need to change the current
# stroke at runtime, so this is read-ony
@GObject.property
@GObject.Property
def current_stroke(self):
return self.strokes[self._current_stroke]

View File

@ -104,14 +104,14 @@ class WacomDevice(GObject.Object):
__gsignals__ = {
'drawing':
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT,)),
'done':
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_PYOBJECT, )),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_PYOBJECT, )),
'button-press-required':
(GObject.SIGNAL_RUN_FIRST, None, ()),
(GObject.SignalFlags.RUN_FIRST, None, ()),
# battery level in %, boolean for is-charging
"battery-status":
(GObject.SIGNAL_RUN_FIRST, None, (GObject.TYPE_INT, GObject.TYPE_BOOLEAN)),
(GObject.SignalFlags.RUN_FIRST, None, (GObject.TYPE_INT, GObject.TYPE_BOOLEAN)),
}
def __init__(self, device, uuid=None):