1
# -*- coding: utf-8 -*-
2
# Copyright © 2005 Lateef Alabi-Oki
4
# This file is part of Scribes.
6
# Scribes is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 2 of the License, or
9
# (at your option) any later version.
11
# Scribes is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
# GNU General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with Scribes; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
21
from dbus.service import Object, method, BusName
23
class DBusService(Object):
25
This class is a D-Bus service that ensures all instances of the
26
editor share the same process.
29
def __init__(self, manager):
31
Initialize the D-Bus service.
33
@param self: Reference to the DBusService instance.
34
@type self: A DBusService object.
36
@param manager: Reference to an object that manages instances of the editor.
37
@type manager: An EditorManager object.
39
from info import session_bus
40
service_name = "net.sourceforge.Scribes"
41
object_path = "/net/sourceforge/Scribes"
42
bus_name = BusName(service_name, bus=session_bus)
43
Object.__init__(self, bus_name, object_path)
44
self.__manager = manager
46
@method("net.sourceforge.Scribes")
47
def open_window(self):
48
return self.__manager.open_window()
50
@method("net.sourceforge.Scribes")
51
def open_files(self, uris):
54
return self.__manager.open_files(uris)