[sugar] [PATCH] sugar.presence.presenceservice: Use absolute imports
Dan Williams
dcbw
Tue May 22 12:25:13 EDT 2007
On Mon, 2007-05-21 at 12:26 +0100, Simon McVittie wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
Sure.
> - ---
> sugar/presence/presenceservice.py | 15 +++------------
> 1 files changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/sugar/presence/presenceservice.py b/sugar/presence/presenceservice.py
> index 9d435e7..a0b60ee 100644
> - --- a/sugar/presence/presenceservice.py
> +++ b/sugar/presence/presenceservice.py
> @@ -23,17 +23,8 @@ import dbus.exceptions
> import dbus.glib
> import gobject
>
> - -# XXX use absolute imports
> - -# from sugar.presence import buddy, activity
> - -# this *kind* of relative import is deprecated
> - -# with an explicit relative import slated to be
> - -# introduced (available in Python 2.5 with a __future__
> - -# import), that would read as:
> - -# from . import buddy, activity
> - -# see PEP: http://docs.python.org/whatsnew/pep-328.html
> - -
> - -import buddy
> - -from activity import Activity
> +from sugar.presence.buddy import Buddy
> +from sugar.presence.activity import Activity
>
>
> DBUS_SERVICE = "org.laptop.Sugar.Presence"
> @@ -163,7 +154,7 @@ class PresenceService(gobject.GObject):
> obj = self._objcache[object_path]
> except KeyError:
> if object_path.startswith(self._PS_BUDDY_OP):
> - - obj = buddy.Buddy(self._bus, self._new_object,
> + obj = Buddy(self._bus, self._new_object,
> self._del_object, object_path)
> elif object_path.startswith(self._PS_ACTIVITY_OP):
> obj = Activity(self._bus, self._new_object,
> - --
> 1.5.2-rc3.GIT
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net
>
> iD8DBQFGUYH3WSc8zVUw7HYRApJwAJ9c8Pvg51cP562OT2Ug9G1kJBqqSwCfc9HC
> OgPfOD8E0M7ZvkBNdPnIkKE=
> =JHie
> -----END PGP SIGNATURE-----
> _______________________________________________
> Sugar mailing list
> Sugar at laptop.org
> http://mailman.laptop.org/mailman/listinfo/sugar
More information about the Sugar-devel
mailing list