Fix up signal decorator arguments and some undefined variables

This commit is contained in:
Dan Williams 2006-07-19 07:36:58 -04:00
parent f413416e15
commit db04a3d2c9
5 changed files with 21 additions and 18 deletions

View File

@ -49,22 +49,22 @@ class ActivityDBusHelper(dbus.service.Object):
return ret return ret
@dbus.service.signal(BUDDY_DBUS_INTERFACE, @dbus.service.signal(BUDDY_DBUS_INTERFACE,
out_signature="o") signature="o")
def ServiceAppeared(self, object_path): def ServiceAppeared(self, object_path):
pass pass
@dbus.service.signal(BUDDY_DBUS_INTERFACE, @dbus.service.signal(BUDDY_DBUS_INTERFACE,
out_signature="o") signature="o")
def ServiceDisappeared(self, object_path): def ServiceDisappeared(self, object_path):
pass pass
@dbus.service.signal(BUDDY_DBUS_INTERFACE, @dbus.service.signal(BUDDY_DBUS_INTERFACE,
out_signature="o") signature="o")
def BuddyJoined(self, object_path): def BuddyJoined(self, object_path):
pass pass
@dbus.service.signal(BUDDY_DBUS_INTERFACE, @dbus.service.signal(BUDDY_DBUS_INTERFACE,
out_signature="o") signature="o")
def BuddyLeft(self, object_path): def BuddyLeft(self, object_path):
pass pass

View File

@ -20,26 +20,27 @@ class BuddyDBusHelper(dbus.service.Object):
dbus.service.Object.__init__(self, bus_name, self._object_path) dbus.service.Object.__init__(self, bus_name, self._object_path)
@dbus.service.signal(BUDDY_DBUS_INTERFACE, @dbus.service.signal(BUDDY_DBUS_INTERFACE,
out_signature="o") signature="o")
def ServiceAppeared(self, object_path): def ServiceAppeared(self, object_path):
pass pass
@dbus.service.signal(BUDDY_DBUS_INTERFACE, @dbus.service.signal(BUDDY_DBUS_INTERFACE,
out_signature="o") signature="o")
def ServiceDisappeared(self, object_path): def ServiceDisappeared(self, object_path):
pass pass
@dbus.service.signal(BUDDY_DBUS_INTERFACE) @dbus.service.signal(BUDDY_DBUS_INTERFACE,
signature="")
def IconChanged(self): def IconChanged(self):
pass pass
@dbus.service.signal(BUDDY_DBUS_INTERFACE, @dbus.service.signal(BUDDY_DBUS_INTERFACE,
out_signature="o") signature="o")
def JoinedActivity(self, object_path): def JoinedActivity(self, object_path):
pass pass
@dbus.service.signal(BUDDY_DBUS_INTERFACE, @dbus.service.signal(BUDDY_DBUS_INTERFACE,
out_signature="o") signature="o")
def LeftActivity(self, object_path): def LeftActivity(self, object_path):
pass pass

View File

@ -75,32 +75,32 @@ class PresenceServiceDBusHelper(dbus.service.Object):
dbus.service.Object.__init__(self, bus_name, _PRESENCE_OBJECT_PATH) dbus.service.Object.__init__(self, bus_name, _PRESENCE_OBJECT_PATH)
@dbus.service.signal(_PRESENCE_DBUS_INTERFACE, @dbus.service.signal(_PRESENCE_DBUS_INTERFACE,
out_signature="o") signature="o")
def BuddyAppeared(self, object_path): def BuddyAppeared(self, object_path):
pass pass
@dbus.service.signal(_PRESENCE_DBUS_INTERFACE, @dbus.service.signal(_PRESENCE_DBUS_INTERFACE,
out_signature="o") signature="o")
def BuddyDisappeared(self, object_path): def BuddyDisappeared(self, object_path):
pass pass
@dbus.service.signal(_PRESENCE_DBUS_INTERFACE, @dbus.service.signal(_PRESENCE_DBUS_INTERFACE,
out_signature="o") signature="o")
def ServiceAppeared(self, object_path): def ServiceAppeared(self, object_path):
pass pass
@dbus.service.signal(_PRESENCE_DBUS_INTERFACE, @dbus.service.signal(_PRESENCE_DBUS_INTERFACE,
out_signature="o") signature="o")
def ServiceDisappeared(self, object_path): def ServiceDisappeared(self, object_path):
pass pass
@dbus.service.signal(_PRESENCE_DBUS_INTERFACE, @dbus.service.signal(_PRESENCE_DBUS_INTERFACE,
out_signature="o") signature="o")
def ActivityAppeared(self, object_path): def ActivityAppeared(self, object_path):
pass pass
@dbus.service.signal(_PRESENCE_DBUS_INTERFACE, @dbus.service.signal(_PRESENCE_DBUS_INTERFACE,
out_signature="o") signature="o")
def ActivityDisappeared(self, object_path): def ActivityDisappeared(self, object_path):
pass pass
@ -137,7 +137,7 @@ class PresenceService(object):
# Connect to Avahi for mDNS stuff # Connect to Avahi for mDNS stuff
self._system_bus = dbus.SystemBus() self._system_bus = dbus.SystemBus()
self._mdns_service = dbus.Interface(self._bus.get_object(avahi.DBUS_NAME, self._mdns_service = dbus.Interface(self._system_bus.get_object(avahi.DBUS_NAME,
avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER) avahi.DBUS_PATH_SERVER), avahi.DBUS_INTERFACE_SERVER)
# Always browse .local # Always browse .local
@ -269,7 +269,7 @@ class PresenceService(object):
"""Resolve and lookup a ZeroConf service to obtain its address and TXT records.""" """Resolve and lookup a ZeroConf service to obtain its address and TXT records."""
# Ask avahi to resolve this particular service # Ask avahi to resolve this particular service
logging.debug('resolving service %s %s' % (adv.name(), adv.stype())) logging.debug('resolving service %s %s' % (adv.name(), adv.stype()))
self._server.ResolveService(int(adv.interface()), int(adv.protocol()), adv.name(), self._mdns_service.ResolveService(int(adv.interface()), int(adv.protocol()), adv.name(),
adv.stype(), adv.domain(), avahi.PROTO_UNSPEC, dbus.UInt32(0), adv.stype(), adv.domain(), avahi.PROTO_UNSPEC, dbus.UInt32(0),
reply_handler=self._resolve_service_reply_cb_glue, reply_handler=self._resolve_service_reply_cb_glue,
error_handler=self._resolve_service_error_handler) error_handler=self._resolve_service_error_handler)
@ -291,7 +291,7 @@ class PresenceService(object):
# Find out the IP address of this interface, if we haven't already # Find out the IP address of this interface, if we haven't already
if interface not in self._local_addrs.keys(): if interface not in self._local_addrs.keys():
ifname = self._server.GetNetworkInterfaceNameByIndex(interface) ifname = self._mdns_service.GetNetworkInterfaceNameByIndex(interface)
if ifname: if ifname:
addr = _get_local_ip_address(ifname) addr = _get_local_ip_address(ifname)
if addr: if addr:

View File

View File

@ -14,6 +14,7 @@ from sugar import env
from sugar.activity import Activity from sugar.activity import Activity
from PeopleWindow import PeopleWindow from PeopleWindow import PeopleWindow
from Owner import ShellOwner from Owner import ShellOwner
from PresenceService import PresenceService
class ShellDbusService(dbus.service.Object): class ShellDbusService(dbus.service.Object):
def __init__(self, shell, bus_name): def __init__(self, shell, bus_name):
@ -50,6 +51,7 @@ class Shell:
bus_name = dbus.service.BusName('com.redhat.Sugar.Shell', bus=session_bus) bus_name = dbus.service.BusName('com.redhat.Sugar.Shell', bus=session_bus)
ShellDbusService(self, bus_name) ShellDbusService(self, bus_name)
self._ps = PresenceService.PresenceService()
self._owner = ShellOwner() self._owner = ShellOwner()
self._registry = ActivityRegistry() self._registry = ActivityRegistry()