From 53ccec52674c28b38fb993c22c2817c30e835db7 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 16 May 2006 19:23:42 -0400 Subject: [PATCH] Forgot to add new file --- sugar/session/LogWriter.py | 14 ++++++++++++++ sugar/session/Makefile.am | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 sugar/session/LogWriter.py diff --git a/sugar/session/LogWriter.py b/sugar/session/LogWriter.py new file mode 100644 index 00000000..92cbf652 --- /dev/null +++ b/sugar/session/LogWriter.py @@ -0,0 +1,14 @@ +import dbus + +class LogWriter: + def __init__(self, application): + self._application = application + bus = dbus.SessionBus() + proxy_obj = bus.get_object('com.redhat.Sugar.Logger', '/com/redhat/Sugar/Logger') + self._logger = dbus.Interface(proxy_obj, 'com.redhat.Sugar.Logger') + + def write(self, s): + try: + self._logger.log(self._application, s) + except: + pass diff --git a/sugar/session/Makefile.am b/sugar/session/Makefile.am index db749876..a8ba9139 100644 --- a/sugar/session/Makefile.am +++ b/sugar/session/Makefile.am @@ -1,4 +1,5 @@ sugardir = $(pythondir)/sugar/session sugar_PYTHON = \ __init__.py \ - session.py + session.py \ + LogWriter.py