[sugar] [patch][connect-activity] Update to high-level API in latest dbus-python
Dafydd Harries
dafydd.harries at collabora.co.uk
Wed May 9 09:15:31 EDT 2007
Ar 08/05/2007 am 12:44, ysgrifennodd Simon McVittie:
> "import dbus.glib" causes side-effects (and is vaguely deprecated for
> that reason), I'm just making it more explicit here. This should probably
> be moved to activity.py and gtkui.py though.
Aye.
> I believe bits of Sugar also import dbus.glib, causing the same magical
> side-effects.
Just because Sugar does it doesn't make it right. ;)
But it's relatively harmless, so I don't really mind where it is.
> > What does this actually do? Does it create a new GLib mainloop? Will it cause
> > odd things to happen if another DBusGMainLoop loop has already been installed?
>
> It uses the global default GLib main loop, and is harmless to do
> multiple times.
For future reference: there is no default GLib main loop, only a default main
context.
> > > +logging.basicConfig()
> > > +_logger = logging.getLogger('connect-activity.client')
> >
> > Is this idempotent? The documentation is ambiguous:
> >
> > Does basic configuration for the logging system by creating a StreamHandler
> > with a default Formatter and adding it to the root logger. The functions
> > debug(), info(), warning(), error() and critical() will call basicConfig()
> > automatically if no handlers are defined for the root logger.
> >
> > Does this cause side effects if a handler is defined for the root logger
> > already? (Whatever that means. :P)
>
> logging.basicConfig() has no effect if there is already a handler on the
> root logger, although this call ought to be in gtkui.py really (Sugar
> already sets up a handler for the root logger).
Ok.
--
Dafydd
More information about the Sugar
mailing list