From fa7a765f4ed866e2c68e4bd7d7ada5548acd9e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= Date: Fri, 30 Aug 2013 14:44:07 -0300 Subject: [PATCH] Drop session.py SessionManager has been moved to shell, and the other class has nothing inside. --- src/sugar3/Makefile.am | 1 - src/sugar3/activity/activity.py | 3 +- src/sugar3/session.py | 52 --------------------------------- 3 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 src/sugar3/session.py diff --git a/src/sugar3/Makefile.am b/src/sugar3/Makefile.am index ba91f6ca..e5e34367 100644 --- a/src/sugar3/Makefile.am +++ b/src/sugar3/Makefile.am @@ -15,7 +15,6 @@ sugar_PYTHON = \ mime.py \ network.py \ profile.py \ - session.py \ util.py XDG_MIME_SOURCES = \ diff --git a/src/sugar3/activity/activity.py b/src/sugar3/activity/activity.py index b0339ec2..6052cdd1 100644 --- a/src/sugar3/activity/activity.py +++ b/src/sugar3/activity/activity.py @@ -81,7 +81,6 @@ from sugar3.graphics.window import Window from sugar3.graphics.alert import Alert from sugar3.graphics.icon import Icon from sugar3.datastore import datastore -from sugar3.session import XSMPClient from gi.repository import SugarExt _ = lambda msg: gettext.dgettext('sugar-toolkit', msg) @@ -109,7 +108,7 @@ class _ActivitySession(GObject.GObject): def __init__(self): GObject.GObject.__init__(self) - self._xsmp_client = XSMPClient() + self._xsmp_client = SugarExt.ClientXSMP() self._xsmp_client.connect('quit-requested', self.__sm_quit_requested_cb) self._xsmp_client.connect('quit', self.__sm_quit_cb) diff --git a/src/sugar3/session.py b/src/sugar3/session.py deleted file mode 100644 index c6ee2fee..00000000 --- a/src/sugar3/session.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2008, Red Hat, Inc. -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -""" -UNSTABLE. Used only internally by jarabe. -""" - -import os - -from gi.repository import SugarExt - - -class XSMPClient(SugarExt.ClientXSMP): - pass - - -class SessionManager(object): - - def __init__(self): - address = SugarExt.xsmp_init() - os.environ['SESSION_MANAGER'] = address - SugarExt.xsmp_run() - - self.session = SugarExt.Session.create_global() - - def start(self): - self.session.start() - self.session.connect('shutdown_completed', - self.__shutdown_completed_cb) - - def initiate_shutdown(self): - self.session.initiate_shutdown() - - def shutdown_completed(self): - SugarExt.xsmp_shutdown() - - def __shutdown_completed_cb(self, session): - self.shutdown_completed()