summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-05-02 10:39:29 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-05-02 10:39:29 +0100
commitba3f3ff253982c9ad3b5a33df5b120e5692c9d29 (patch)
treee0c2e456cdccb30bfa594a83b4d8797bf925995f
parentf264e37f13720898d941f3636f77c489a9a1d845 (diff)
downloaddbus-python-ba3f3ff253982c9ad3b5a33df5b120e5692c9d29.tar.gz
Rename gobject_service (PyGI version) to gi_service
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48904
-rw-r--r--Makefile.am2
-rw-r--r--dbus/gi_service.py (renamed from dbus/gobject_service.py)12
-rwxr-xr-xtest/test-service.py10
3 files changed, 12 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am
index f3a57de..f244061 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,8 +26,8 @@ nobase_python_PYTHON = \
dbus/decorators.py \
dbus/exceptions.py \
dbus/_expat_introspect_parser.py \
+ dbus/gi_service.py \
dbus/glib.py \
- dbus/gobject_service.py \
dbus/__init__.py \
dbus/lowlevel.py \
dbus/mainloop/__init__.py \
diff --git a/dbus/gobject_service.py b/dbus/gi_service.py
index 47a2b5f..924442f 100644
--- a/dbus/gobject_service.py
+++ b/dbus/gi_service.py
@@ -1,4 +1,4 @@
-"""Support code for implementing D-Bus services via GObjects."""
+"""Support code for implementing D-Bus services via PyGI."""
# Copyright (C) 2007 Collabora Ltd. <http://www.collabora.co.uk/>
#
@@ -24,7 +24,7 @@
__all__ = ['ExportedGObject']
-from gi.repository import GObject as gobject
+from gi.repository import GObject
import dbus.service
# The odd syntax used here is required so that the code is compatible with
@@ -37,12 +37,12 @@ import dbus.service
# `ExportedGObjectType` as its metaclass, which is sufficient to make it work
# correctly.
-class ExportedGObjectType(gobject.GObjectMeta, dbus.service.InterfaceType):
+class ExportedGObjectType(GObject.GObjectMeta, dbus.service.InterfaceType):
"""A metaclass which inherits from both GObjectMeta and
`dbus.service.InterfaceType`. Used as the metaclass for `ExportedGObject`.
"""
def __init__(cls, name, bases, dct):
- gobject.GObjectMeta.__init__(cls, name, bases, dct)
+ GObject.GObjectMeta.__init__(cls, name, bases, dct)
dbus.service.InterfaceType.__init__(cls, name, bases, dct)
@@ -68,7 +68,7 @@ def ExportedGObject__init__(self, conn=None, object_path=None, **kwargs):
if gobject_properties is not None:
kwargs.update(gobject_properties)
- gobject.GObject.__init__(self, **kwargs)
+ GObject.GObject.__init__(self, **kwargs)
dbus.service.Object.__init__(self, conn=conn,
object_path=object_path,
bus_name=bus_name)
@@ -77,7 +77,7 @@ ExportedGObject__doc__ = 'A GObject which is exported on the D-Bus.'
ExportedGObject = ExportedGObjectType(
'ExportedGObject',
- (gobject.GObject, dbus.service.Object),
+ (GObject.GObject, dbus.service.Object),
{'__init__': ExportedGObject__init__,
'__doc__': ExportedGObject__doc__,
})
diff --git a/test/test-service.py b/test/test-service.py
index a4448f6..a7bf469 100755
--- a/test/test-service.py
+++ b/test/test-service.py
@@ -39,8 +39,8 @@ import dbus.service
import dbus.glib
import random
-from dbus.gobject_service import ExportedGObject
-from gi.repository import GObject as gobject
+from dbus.gi_service import ExportedGObject
+from gi.repository import GObject
from dbus._compat import is_py2, is_py3
@@ -263,7 +263,7 @@ class TestObject(dbus.service.Object, TestInterface):
def AsynchronousMethod(self, async, fail, variant, return_cb, error_cb):
try:
if async:
- gobject.timeout_add(500, self.AsynchronousMethod, False, fail,
+ GObject.timeout_add(500, self.AsynchronousMethod, False, fail,
variant, return_cb, error_cb)
return
else:
@@ -310,7 +310,7 @@ class TestObject(dbus.service.Object, TestInterface):
def return_from_async_wait():
return_cb()
return False
- gobject.timeout_add(500, return_from_async_wait)
+ GObject.timeout_add(500, return_from_async_wait)
@dbus.service.method(IFACE, in_signature='', out_signature='')
def RaiseValueError(self):
@@ -356,7 +356,7 @@ def main():
logger.info('making Fallback')
fallback_object = Fallback(session_bus)
logger.info('creating mainloop')
- loop = gobject.MainLoop()
+ loop = GObject.MainLoop()
logger.info('running')
loop.run()
logger.info('done')