From 2752c29bab647cd8bf8c2231f183d993cb22fc96 Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Mon, 2 Feb 2009 14:23:56 +0000 Subject: [PATCH] uprade paroli the next working version, removing everything but the dialer, modify naming and desktop-files SVN-Revision: 14353 --- phone/paroli/Makefile | 23 +- phone/paroli/files/paroli.init | 6 +- .../050-adjust-desktop-files-and-naming.patch | 973 ++++++++++++++++++ .../patches/050-adjust-desktop-files.patch | 121 --- .../paroli/patches/100-workaround-bugs.patch | 12 - 5 files changed, 986 insertions(+), 149 deletions(-) create mode 100644 phone/paroli/patches/050-adjust-desktop-files-and-naming.patch delete mode 100644 phone/paroli/patches/050-adjust-desktop-files.patch delete mode 100644 phone/paroli/patches/100-workaround-bugs.patch diff --git a/phone/paroli/Makefile b/phone/paroli/Makefile index 83d0d83c77..16e0c96636 100644 --- a/phone/paroli/Makefile +++ b/phone/paroli/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=paroli -PKG_VERSION:=20090121 -PKG_REV:=9279b50ed72a94100d7f0f49090043134302f2eb -PKG_RELEASE:=2 +PKG_VERSION:=20090202 +PKG_REV:=497fb67c507ff58fe72c5399a37906a6aee97015 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://git.paroli-project.org/paroli.git @@ -32,10 +32,7 @@ define Package/paroli endef COMPONENTS:= \ - paroli-dialer \ - paroli-contacts \ - paroli-i-o \ - paroli-msgs \ + tele \ define Package/paroli/description Paroli is an integrated phone application written in Python which uses the FSO (freesmartphone.org) DBus API @@ -58,23 +55,23 @@ define Package/paroli/install $(foreach c, $(COMPONENTS), \ $(INSTALL_DIR) $(1)/usr/share/paroli/applications/$(c) $(CP) $(PKG_INSTALL_DIR)/../usr/share/paroli/applications/$(c)/$(c).{py,edj} $(1)/usr/share/paroli/applications/$(c)/ - $(CP) $(PKG_INSTALL_DIR)/../usr/share/paroli/applications/$(c)/icon.png $(1)/usr/share/icons/paroli/$(c).png +# $(CP) $(PKG_INSTALL_DIR)/../usr/share/paroli/applications/$(c)/icon.png $(1)/usr/share/icons/paroli/$(c).png + $(CP) $(PKG_INSTALL_DIR)/../data/tichy $(1)/usr/share/icons/paroli/$(c).png + $(CP) $(PKG_INSTALL_DIR)/usr/applications/$(c).desktop $(1)/usr/share/applications/paroli/ ) $(CP) \ $(PKG_INSTALL_DIR)/../usr/share/paroli/services/* \ $(1)/usr/share/paroli/services/ $(CP) \ $(PKG_INSTALL_DIR)/../data/tichy \ - $(1)/usr/share/icons/paroli/tichy.png + $(1)/usr/share/icons/paroli/parolid.png $(CP) \ - $(PKG_INSTALL_DIR)/usr/applications/*.desktop \ - $(1)/usr/share/applications/paroli/ - $(CP) \ - $(PKG_INSTALL_DIR)/usr/applications/paroli-launcher.desktop \ + $(PKG_INSTALL_DIR)/usr/applications/parolid.desktop \ $(1)/etc/xdg/autostart/ $(CP) \ $(PKG_INSTALL_DIR)/../etc/* \ $(1)/etc/ + $(CP) ./files/paroli.cfg $(1)/etc/paroli.cfg endef $(eval $(call BuildPackage,paroli)) diff --git a/phone/paroli/files/paroli.init b/phone/paroli/files/paroli.init index 0bbc58a97f..d724ecccbd 100644 --- a/phone/paroli/files/paroli.init +++ b/phone/paroli/files/paroli.init @@ -3,9 +3,9 @@ START=99 start() { - (sleep 60 && DISPLAY=":0" LD_PRELOAD=/usr/lib/libX11.so /usr/bin/paroli-launcher) & # sleep to wait until the xserver is started | LD_PRELOAD to workaround some runtime linking problems - needs to be fixed + (sleep 60 && DISPLAY=":0" /usr/bin/parolid) & # give xserver some time to get initialized } - + stop() { - killall paroli-launcher + killall parolid } diff --git a/phone/paroli/patches/050-adjust-desktop-files-and-naming.patch b/phone/paroli/patches/050-adjust-desktop-files-and-naming.patch new file mode 100644 index 0000000000..b1ca9abf97 --- /dev/null +++ b/phone/paroli/patches/050-adjust-desktop-files-and-naming.patch @@ -0,0 +1,973 @@ +diff -ruN paroli.orig/data/paroli-contacts.desktop paroli/data/paroli-contacts.desktop +--- paroli.orig/data/paroli-contacts.desktop 2009-02-02 14:20:01.000000000 +0100 ++++ paroli/data/paroli-contacts.desktop 2009-02-02 14:24:26.000000000 +0100 +@@ -1,16 +1,13 @@ + [Desktop Entry] +-Name=People +-Name[fr]=Calculatrice +-Name[it]=Calcolatrice +-Name[ru]=Калькулятор +-Name[sv]=Miniräknare ++GenericName=Contacts ++Name=Contacts + Encoding=UTF-8 + Version=1.0 +-Comment=Paroli Dialer ++Comment=Paroli Contacts + StartupNotify=false + Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Paroli-Contacts +-Icon=openmoko-calculator +-Terminal=true ++Icon=/usr/share/icons/paroli/paroli-contacts.png ++Terminal=false + Type=Application + SingleInstance=true +-Categories=GTK;Application;Office; +\ No newline at end of file ++Categories=Telephony;TelephonyTools +diff -ruN paroli.orig/data/parolid.desktop paroli/data/parolid.desktop +--- paroli.orig/data/parolid.desktop 1970-01-01 01:00:00.000000000 +0100 ++++ paroli/data/parolid.desktop 2009-02-02 14:24:26.000000000 +0100 +@@ -0,0 +1,13 @@ ++[Desktop Entry] ++GenericName=Paroli ++Name=Paroli ++Encoding=UTF-8 ++Version=1.0 ++Comment=Paroli Daemon ++StartupNotify=false ++Exec=parolid ++Icon=/usr/share/icons/paroli/parolid.png ++Terminal=false ++Type=Application ++SingleInstance=true ++Categories=Telephony;TelephonyTools +diff -ruN paroli.orig/data/paroli-dialer.desktop paroli/data/paroli-dialer.desktop +--- paroli.orig/data/paroli-dialer.desktop 2009-02-02 14:20:01.000000000 +0100 ++++ paroli/data/paroli-dialer.desktop 2009-02-02 14:24:26.000000000 +0100 +@@ -1,16 +1,13 @@ + [Desktop Entry] +-Name=Tele +-Name[fr]=Calculatrice +-Name[it]=Calcolatrice +-Name[ru]=Калькулятор +-Name[sv]=Miniräknare ++GenericName=Dialer ++Name=Dialer + Encoding=UTF-8 + Version=1.0 + Comment=Paroli Dialer + StartupNotify=false + Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Paroli-Dialer +-Icon=openmoko-calculator +-Terminal=true ++Icon=/usr/share/icons/paroli/paroli-dialer.png ++Terminal=false + Type=Application + SingleInstance=true +-Categories=GTK;Application;Office; +\ No newline at end of file ++Categories=Telephony;TelephonyTools +diff -ruN paroli.orig/data/paroli-i-o.desktop paroli/data/paroli-i-o.desktop +--- paroli.orig/data/paroli-i-o.desktop 1970-01-01 01:00:00.000000000 +0100 ++++ paroli/data/paroli-i-o.desktop 2009-02-02 14:24:26.000000000 +0100 +@@ -0,0 +1,13 @@ ++[Desktop Entry] ++GenericName=I/O ++Name=I/O ++Encoding=UTF-8 ++Version=1.0 ++Comment=Paroli I/O ++StartupNotify=false ++Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Paroli-I/O ++Icon=openmoko-calculator ++Terminal=true ++Type=Application ++SingleInstance=true ++Categories=GTK;Application;Office; +diff -ruN paroli.orig/data/paroli-io.desktop paroli/data/paroli-io.desktop +--- paroli.orig/data/paroli-io.desktop 2009-02-02 14:20:01.000000000 +0100 ++++ paroli/data/paroli-io.desktop 1970-01-01 01:00:00.000000000 +0100 +@@ -1,16 +0,0 @@ +-[Desktop Entry] +-Name=I/O +-Name[fr]=Calculatrice +-Name[it]=Calcolatrice +-Name[ru]=Калькулятор +-Name[sv]=Miniräknare +-Encoding=UTF-8 +-Version=1.0 +-Comment=Paroli I/O +-StartupNotify=false +-Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Paroli-I/O +-Icon=openmoko-calculator +-Terminal=true +-Type=Application +-SingleInstance=true +-Categories=GTK;Application;Office; +\ No newline at end of file +diff -ruN paroli.orig/data/paroli-launcher.desktop paroli/data/paroli-launcher.desktop +--- paroli.orig/data/paroli-launcher.desktop 2009-02-02 14:20:01.000000000 +0100 ++++ paroli/data/paroli-launcher.desktop 2009-02-02 14:24:26.000000000 +0100 +@@ -1,11 +1,13 @@ + [Desktop Entry] +-Name=PLauncher +-TryExec=paroli-launcher +-Icon=tichy + GenericName=paroli-launcher ++Name=PLauncher ++Encoding=UTF-8 ++Version=1.0 + Comment=Paroli Launcher + StartupNotify=false + Exec=paroli-launcher ++Icon=/usr/share/icons/paroli/paroli-launcher.png + Terminal=false + Type=Application +-Categories=Office; ++SingleInstance=true ++Categories=Telephony;TelephonyTools +diff -ruN paroli.orig/data/paroli-msgs.desktop paroli/data/paroli-msgs.desktop +--- paroli.orig/data/paroli-msgs.desktop 2009-02-02 14:20:01.000000000 +0100 ++++ paroli/data/paroli-msgs.desktop 2009-02-02 14:24:26.000000000 +0100 +@@ -1,16 +1,13 @@ + [Desktop Entry] +-Name=Msgs +-Name[fr]=Calculatrice +-Name[it]=Calcolatrice +-Name[ru]=Калькулятор +-Name[sv]=Miniräknare ++GenericName=Messages ++Name=Messages + Encoding=UTF-8 + Version=1.0 + Comment=Paroli Messages + StartupNotify=false + Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Paroli-Msgs +-Icon=openmoko-calculator +-Terminal=true ++Icon=/usr/share/icons/paroli/paroli-msgs.png ++Terminal=false + Type=Application + SingleInstance=true +-Categories=GTK;Application;Office; +\ No newline at end of file ++Categories=Telephony;TelephonyTools +diff -ruN paroli.orig/data/tele.desktop paroli/data/tele.desktop +--- paroli.orig/data/tele.desktop 1970-01-01 01:00:00.000000000 +0100 ++++ paroli/data/tele.desktop 2009-02-02 14:24:26.000000000 +0100 +@@ -0,0 +1,13 @@ ++[Desktop Entry] ++GenericName=Tele ++Name=Tele ++Encoding=UTF-8 ++Version=1.0 ++Comment=Paroli Tele ++StartupNotify=false ++Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Tele ++Icon=/usr/share/icons/paroli/tele.png ++Terminal=false ++Type=Application ++SingleInstance=true ++Categories=Telephony;TelephonyTools +diff -ruN paroli.orig/paroli-scripts/paroli paroli/paroli-scripts/paroli +--- paroli.orig/paroli-scripts/paroli 2009-02-02 14:20:01.000000000 +0100 ++++ paroli/paroli-scripts/paroli 1970-01-01 01:00:00.000000000 +0100 +@@ -1,188 +0,0 @@ +-#!/usr/bin/python +-# +-# Paroli +-# +-# copyright 2008 Openmoko +-# +-# This file is part of Paroli. +-# +-# Paroli is free software: you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by +-# the Free Software Foundation, either version 3 of the License, or +-# (at your option) any later version. +-# +-# Paroli 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 +-# General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with Paroli. If not, see . +- +-"""Paroli main script +- +-This script will load all the paroli plugins, then init the services, +-and finally run the application 'Paroli-Launcher' +-""" +- +-# All the needed system modules +-import sys +-import os +-from optparse import OptionParser +-import ConfigParser +-import logging +- +-# This is to make sure that we use the local tichy lib if run from the +-# test directory +-sys.path.insert(0, '../paroli-core/') +-sys.path.insert(0, '../paroli-graphics-backend/') +- +-import tichy +- +-logger = logging.getLogger('') +- +- +-def parse_options(): +- """Parse the command line options +- +- :Returns: the OptionParser result object +- """ +- parser = OptionParser() +- parser.add_option("", "--cfgfile", dest="cfg_file", +- help="specigy the configuration file to use", +- metavar="FILE", default=None) +- parser.add_option("", "--show-services", dest='show_services', +- action='store_true', default=False, +- help="print some info about the services and exit") +- +- (options, args) = parser.parse_args() +- return options +- +- +-def setup_logging(): +- """Set up two logging handlers, one in the log file, one in the +- stdoutput""" +- logging.basicConfig( +- level=logging.DEBUG, +- format='%(asctime)s %(name)-8s %(levelname)-8s %(message)s', +- filename='/tmp/paroli.log', filemode='w') +- +- formatter = logging.Formatter( +- '%(name)-8s %(levelname)-8s %(message)s') +- stream_log = logging.StreamHandler() +- stream_log.setFormatter(formatter) +- stream_log.setLevel(logging.INFO) +- logger.addHandler(stream_log) +- +- +-def parse_config(cfg_file=None): +- """parse the config files +- +- We look into 3 locations : first the local dir, then /etc/paroli/, +- then the home directory +- +- :Parameters: +- +- cfg_file : str | None +- the configuartion file to use, or None for default config +- files +- +- :Returns: the ConfigParser object +- """ +- config = ConfigParser.SafeConfigParser() +- if not cfg_file: +- local_path = "./paroli.cfg" +- system_path = "/etc/paroli/paroli.cfg" +- home_path = os.path.expanduser("~/.paroli/paroli.cfg") +- files = [local_path, system_path, home_path] +- else: +- files = cfg_file.split(':') +- for path in files: +- logger.info("read config file %s", path) +- config.read(path) +- return config +- +- +-class InitAll(tichy.Tasklet): +- """Perform all basic initialization of services""" +- +- def run(self): +- # Register on the GSM Network +- gsm_service = tichy.Service('GSM') +- yield gsm_service.init() +- # Set SIM info +- gsm_sim = tichy.Service('SIM') +- yield gsm_sim.set_info() +- # Get all the contacts +- contacts = tichy.Service('Contacts') +- yield contacts.init() +- messages_service = tichy.Service('Messages') +- yield messages_service.init() +- +- # Finally we can start to listen for incoming calls +- logger.info("start AutoAnswerCall") +- yield AutoAnswerCall() +- +-class AutoAnswerCall(tichy.Tasklet): +- +- def run(self): +- # We don't create any window, just run in the background... +- # warning; that would only work with gtk or etk backend... +- gsm_service = tichy.Service('GSM') +- while True: +- call = yield tichy.Wait(gsm_service, 'incoming-call') +- logger.info("got incoming call") +- caller_service = tichy.Service('Caller') +- yield caller_service.call(None, call) +- +- +-if __name__ == '__main__': +- options = parse_options() +- +- setup_logging() +- config = parse_config(cfg_file=options.cfg_file) +- +- logger.info("init gui") +- tichy.init_gui(None) +- +- # We import all the modules into the plugin directory +- default_plugins_path = '/usr/share/tichy/plugins' +- plugins_dir = config.get('plugins', 'path', default_plugins_path) +- plugins_dirs = plugins_dir.split(':') +- for plugins_dir in plugins_dirs: +- try: +- logger.info("try to load plugins in %s", plugins_dir) +- tichy.plugins.import_all(plugins_dir) +- except IOError: +- logger.info("failed to load plugins in %s", plugins_dir) +- +- # Set all the default services +- if config.has_option('services', 'defaults'): +- defaults = config.get('services', 'defaults').split(',') +- for default in defaults: +- if not default: +- continue +- service, name = default.strip().split(':') +- logger.info("set service %s to %s", service, name) +- tichy.Service.set_default(service, name) +- +- if options.show_services: +- from tichy.service import print_infos +- print_infos() +- sys.exit(0) +- +- def on_done(): +- """called when the main application quit""" +- tichy.mainloop.quit() +- +- logger.info("start InitAll") +- InitAll().start() +- +- logger.info("start launcher application") +- launcher = tichy.Application.find_by_name('Paroli-Launcher') +- # '01' for standalone and advanced-mode +- launcher(None, '01').start(callback=on_done) +- +- logger.info("starting mainloop") +- tichy.mainloop.run() +- logger.info("quit") +diff -ruN paroli.orig/paroli-scripts/parolid paroli/paroli-scripts/parolid +--- paroli.orig/paroli-scripts/parolid 1970-01-01 01:00:00.000000000 +0100 ++++ paroli/paroli-scripts/parolid 2009-02-02 14:20:41.000000000 +0100 +@@ -0,0 +1,289 @@ ++#!/usr/bin/python ++# ++# Paroli ++# ++# copyright 2008 Openmoko ++# Guillaume Chereau (charlie@openmoko.org) ++# ++# This file is part of Paroli. ++# ++# Paroli is free software: you can redistribute it and/or modify it ++# under the terms of the GNU General Public License as published by ++# the Free Software Foundation, either version 3 of the License, or ++# (at your option) any later version. ++# ++# Paroli 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 ++# General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with Paroli. If not, see . ++ ++"""DBus launcher paroli main script ++ ++This script will load all the plugins, then start a DBus server ++listening that we can use to start any application. ++ ++It is still experimental. ++ ++To use it, start it (./launcher.py), then use for example dbus-send to ++start an application, e.g. : dbus-send --session \ ++--dest='org.tichy.launcher' /Launcher --print-reply \ ++org.tichy.Launcher.Launch string:Contacts ++ ++Note for neo : We need to remember to set DISPLAY=:0 even when we call ++the dbus method ! ++""" ++ ++#import time ++ ++#print time.ctime() ++ ++import os ++import sys ++import dbus ++import dbus.service ++from optparse import OptionParser ++import logging ++#import profile ++#print time.ctime() ++ ++# This is to make sure that we use the local tichy lib if run from the ++# test directory ++sys.path.insert(0, '../paroli-core/') ++sys.path.insert(0, '../paroli-graphics-backend/') ++ ++#def profiling(): ++import tichy ++ ++#profile.run('profiling()','mirko.txt') ++ ++#print time.ctime() ++ ++logger = logging.getLogger('') ++ ++ ++def parse_options(): ++ """Parse the command line options ++ ++ :Returns: the OptionParser result object ++ """ ++ parser = OptionParser() ++ parser.add_option("", "--experimental", ++ action='store_true', dest="experimental", ++ help="Use experimental features", ++ default=False) ++ parser.add_option("", "--session", ++ action='store_const', dest='bus', ++ help="Connect to the session bus", ++ const='session', default='system') ++ parser.add_option("", "--launch", dest='launch', ++ help="launch an applet using DBus", ++ metavar="APPLICATION", ++ default=None) ++ parser.add_option("", "--cfgfile", dest="cfg_file", ++ help="specigy the configuration file to use", ++ metavar="FILE", default=None) ++ parser.add_option("", "--show-services", dest='show_services', ++ action='store_true', default=False, ++ help="print some info about the services and exit") ++ ++ (options, args) = parser.parse_args() ++ return options ++ ++ ++def setup_logging(): ++ """Set up two logging handlers, one in the log file, one in the ++ stdoutput""" ++ logging.basicConfig( ++ level=logging.DEBUG, ++ format='%(asctime)s %(name)-8s %(levelname)-8s %(message)s', ++ filename='/tmp/paroli.log', filemode='w') ++ ++ formatter = logging.Formatter( ++ '%(filename)s %(lineno)d %(name)-8s %(levelname)-8s %(message)s') ++ stream_log = logging.StreamHandler() ++ stream_log.setFormatter(formatter) ++ stream_log.setLevel(logging.INFO) ++ logger.addHandler(stream_log) ++ ++ ++class InitAll(tichy.Tasklet): ++ """Perform all basic initialization of services""" ++ ++ def run(self): ++ ++ storage_service = tichy.Service('TeleCom') ++ #print "storage in p-launcher" ++ yield storage_service.init() ++ ++ # Register on the GSM Network ++ gsm_service = tichy.Service('GSM') ++ yield gsm_service.init() ++ # Set SIM info ++ gsm_sim = tichy.Service('SIM') ++ yield gsm_sim.set_info() ++ # Get all the contacts ++ contacts = tichy.Service('Contacts') ++ yield contacts.init() ++ messages_service = tichy.Service('Messages') ++ yield messages_service.init() ++ ++ caller_service = tichy.Service('TeleCaller') ++ yield caller_service.init() ++ ++ audio_service = tichy.Service('Audio') ++ yield audio_service.init() ++ ++ # Finally we can start to listen for incoming calls ++ logger.info("start AutoAnswerCall") ++ yield AutoAnswerCall() ++ ++ ++class AutoAnswerCall(tichy.Tasklet): ++ ++ def run(self): ++ # We don't create any window, just run in the background... ++ # warning; that would only work with gtk or etk backend... ++ gsm_service = tichy.Service('GSM') ++ while True: ++ call = yield tichy.Wait(gsm_service, 'incoming-call') ++ logger.info("got incoming call") ++ caller_service = tichy.Service('TeleCaller') ++ yield caller_service.call("None", call) ++ ++ ++class Launcher(dbus.service.Object): ++ """Launch applets via DBus call ++ ++ example, to launch the Contacts application, using dbus-send : ++ dbus-send --system --dest='org.tichy' /Launcher --print-reply \ ++ org.tichy.Launcher.Launch string:Contacts ++ """ ++ ++ def __init__(self, *args, **kargs): ++ super(Launcher, self).__init__(*args, **kargs) ++ self.screen = None ++ logger.info("registered applications :") ++ for app in tichy.Application.subclasses: ++ if app.name: ++ logger.info("- %s", app.name) ++ ++ @dbus.service.method("org.tichy.Launcher", "s") ++ def Launch(self, name): ++ """Launch a registered tichy application by name""" ++ logger.info("launch %s", name) ++ for app in tichy.Application.subclasses: ++ if app.name == name: ++ self.launch(app).start() ++ break ++ else: ++ logger.error("no application named %s", name) ++ ++ @tichy.tasklet.tasklet ++ def launch(self, app): ++ """Actually launch the application""" ++ kill_on_close = False ++ if not self.screen: ++ self.screen = self.create_screen() ++ kill_on_close = False ++ try: ++ yield app(None) ++ except Exception, ex: ++ logger.error("application %s failed : %s", app.name, ex) ++ import traceback ++ logger.error(traceback.format_exc()) ++ if kill_on_close: ++ self.screen.destroy() ++ self.screen = None ++ ++ def create_screen(self): ++ #window = tichy.gui.Window(480,580) ++ #window.show() ++ window = None ++ return window ++ ++ @dbus.service.method("org.tichy.Launcher") ++ def Quit(self): ++ """Quit tichy""" ++ logger.info("quit mainloop") ++ tichy.mainloop.quit() ++ ++ ++def launch(name, options): ++ """Use dbus to call the launcher""" ++ if options.bus == 'system': ++ bus = dbus.SystemBus() ++ else: ++ bus = dbus.SessionBus() ++ launcher = bus.get_object('org.tichy.launcher', '/Launcher') ++ launcher = dbus.Interface(launcher, 'org.tichy.Launcher') ++ launcher.Launch(options.launch) ++ ++ ++if __name__ == '__main__': ++ options = parse_options() ++ ++ if options.launch: ++ launch(options.launch, options) ++ sys.exit(0) ++ ++ setup_logging() ++ tichy.config.parse(cfg_file=options.cfg_file) ++ ++ logger.info("init gui") ++ tichy.init_gui(None) ++ ++ # We import all the modules into the plugin directory ++ default_plugins_path = '/usr/share/tichy/plugins' ++ plugins_dir = tichy.config.get('plugins', 'path', default_plugins_path) ++ plugins_dirs = plugins_dir.split(':') ++ for plugins_dir in plugins_dirs: ++ print plugins_dir ++ try: ++ logger.info("try to load plugins in %s", plugins_dir) ++ tichy.plugins.import_all(plugins_dir) ++ except IOError: ++ logger.info("failed to load plugins in %s", plugins_dir) ++ ++ # Set all the default services ++ defaults = tichy.config.get('services', 'defaults', None) ++ if defaults: ++ defaults = defaults.split(',') ++ for default in defaults: ++ if not default: ++ continue ++ service, name = default.strip().split(':') ++ logger.info("set service %s to %s", service, name) ++ tichy.Service.set_default(service, name) ++ ++ if options.show_services: ++ from tichy.service import print_infos ++ print_infos() ++ sys.exit(0) ++ if tichy.config.getboolean('dbus','activated', False): ++ logger.info("connect to dbus") ++ if options.bus == 'system': ++ bus = dbus.SystemBus(mainloop=tichy.mainloop.dbus_loop) ++ else: ++ bus = dbus.SessionBus(mainloop=tichy.mainloop.dbus_loop) ++ bus_name = dbus.service.BusName('org.tichy.launcher', bus) ++ ++ logger.info("start launcher service") ++ launcher = Launcher(bus, '/Launcher') ++ ++ logger.info("start InitAll") ++ InitAll().start() ++ ++ app_name = tichy.config.get('autolaunch', 'application', None) ++ if app_name: ++ standalone = tichy.config.getboolean('standalone', 'activated', False) ++ for app in tichy.Application.subclasses: ++ if app.name == app_name: ++ app("None", standalone=standalone).start() ++ ++ ++ logger.info("starting mainloop") ++ tichy.mainloop.run() ++ logger.info("quit") +diff -ruN paroli.orig/paroli-scripts/paroli-launcher paroli/paroli-scripts/paroli-launcher +--- paroli.orig/paroli-scripts/paroli-launcher 2009-02-02 14:20:01.000000000 +0100 ++++ paroli/paroli-scripts/paroli-launcher 1970-01-01 01:00:00.000000000 +0100 +@@ -1,289 +0,0 @@ +-#!/usr/bin/python +-# +-# Paroli +-# +-# copyright 2008 Openmoko +-# Guillaume Chereau (charlie@openmoko.org) +-# +-# This file is part of Paroli. +-# +-# Paroli is free software: you can redistribute it and/or modify it +-# under the terms of the GNU General Public License as published by +-# the Free Software Foundation, either version 3 of the License, or +-# (at your option) any later version. +-# +-# Paroli 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 +-# General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with Paroli. If not, see . +- +-"""DBus launcher paroli main script +- +-This script will load all the plugins, then start a DBus server +-listening that we can use to start any application. +- +-It is still experimental. +- +-To use it, start it (./launcher.py), then use for example dbus-send to +-start an application, e.g. : dbus-send --session \ +---dest='org.tichy.launcher' /Launcher --print-reply \ +-org.tichy.Launcher.Launch string:Contacts +- +-Note for neo : We need to remember to set DISPLAY=:0 even when we call +-the dbus method ! +-""" +- +-#import time +- +-#print time.ctime() +- +-import os +-import sys +-import dbus +-import dbus.service +-from optparse import OptionParser +-import logging +-#import profile +-#print time.ctime() +- +-# This is to make sure that we use the local tichy lib if run from the +-# test directory +-sys.path.insert(0, '../paroli-core/') +-sys.path.insert(0, '../paroli-graphics-backend/') +- +-#def profiling(): +-import tichy +- +-#profile.run('profiling()','mirko.txt') +- +-#print time.ctime() +- +-logger = logging.getLogger('') +- +- +-def parse_options(): +- """Parse the command line options +- +- :Returns: the OptionParser result object +- """ +- parser = OptionParser() +- parser.add_option("", "--experimental", +- action='store_true', dest="experimental", +- help="Use experimental features", +- default=False) +- parser.add_option("", "--session", +- action='store_const', dest='bus', +- help="Connect to the session bus", +- const='session', default='system') +- parser.add_option("", "--launch", dest='launch', +- help="launch an applet using DBus", +- metavar="APPLICATION", +- default=None) +- parser.add_option("", "--cfgfile", dest="cfg_file", +- help="specigy the configuration file to use", +- metavar="FILE", default=None) +- parser.add_option("", "--show-services", dest='show_services', +- action='store_true', default=False, +- help="print some info about the services and exit") +- +- (options, args) = parser.parse_args() +- return options +- +- +-def setup_logging(): +- """Set up two logging handlers, one in the log file, one in the +- stdoutput""" +- logging.basicConfig( +- level=logging.DEBUG, +- format='%(asctime)s %(name)-8s %(levelname)-8s %(message)s', +- filename='/tmp/paroli.log', filemode='w') +- +- formatter = logging.Formatter( +- '%(filename)s %(lineno)d %(name)-8s %(levelname)-8s %(message)s') +- stream_log = logging.StreamHandler() +- stream_log.setFormatter(formatter) +- stream_log.setLevel(logging.INFO) +- logger.addHandler(stream_log) +- +- +-class InitAll(tichy.Tasklet): +- """Perform all basic initialization of services""" +- +- def run(self): +- +- storage_service = tichy.Service('TeleCom') +- #print "storage in p-launcher" +- yield storage_service.init() +- +- # Register on the GSM Network +- gsm_service = tichy.Service('GSM') +- yield gsm_service.init() +- # Set SIM info +- gsm_sim = tichy.Service('SIM') +- yield gsm_sim.set_info() +- # Get all the contacts +- contacts = tichy.Service('Contacts') +- yield contacts.init() +- messages_service = tichy.Service('Messages') +- yield messages_service.init() +- +- caller_service = tichy.Service('TeleCaller') +- yield caller_service.init() +- +- audio_service = tichy.Service('Audio') +- yield audio_service.init() +- +- # Finally we can start to listen for incoming calls +- logger.info("start AutoAnswerCall") +- yield AutoAnswerCall() +- +- +-class AutoAnswerCall(tichy.Tasklet): +- +- def run(self): +- # We don't create any window, just run in the background... +- # warning; that would only work with gtk or etk backend... +- gsm_service = tichy.Service('GSM') +- while True: +- call = yield tichy.Wait(gsm_service, 'incoming-call') +- logger.info("got incoming call") +- caller_service = tichy.Service('TeleCaller') +- yield caller_service.call("None", call) +- +- +-class Launcher(dbus.service.Object): +- """Launch applets via DBus call +- +- example, to launch the Contacts application, using dbus-send : +- dbus-send --system --dest='org.tichy' /Launcher --print-reply \ +- org.tichy.Launcher.Launch string:Contacts +- """ +- +- def __init__(self, *args, **kargs): +- super(Launcher, self).__init__(*args, **kargs) +- self.screen = None +- logger.info("registered applications :") +- for app in tichy.Application.subclasses: +- if app.name: +- logger.info("- %s", app.name) +- +- @dbus.service.method("org.tichy.Launcher", "s") +- def Launch(self, name): +- """Launch a registered tichy application by name""" +- logger.info("launch %s", name) +- for app in tichy.Application.subclasses: +- if app.name == name: +- self.launch(app).start() +- break +- else: +- logger.error("no application named %s", name) +- +- @tichy.tasklet.tasklet +- def launch(self, app): +- """Actually launch the application""" +- kill_on_close = False +- if not self.screen: +- self.screen = self.create_screen() +- kill_on_close = False +- try: +- yield app(None) +- except Exception, ex: +- logger.error("application %s failed : %s", app.name, ex) +- import traceback +- logger.error(traceback.format_exc()) +- if kill_on_close: +- self.screen.destroy() +- self.screen = None +- +- def create_screen(self): +- #window = tichy.gui.Window(480,580) +- #window.show() +- window = None +- return window +- +- @dbus.service.method("org.tichy.Launcher") +- def Quit(self): +- """Quit tichy""" +- logger.info("quit mainloop") +- tichy.mainloop.quit() +- +- +-def launch(name, options): +- """Use dbus to call the launcher""" +- if options.bus == 'system': +- bus = dbus.SystemBus() +- else: +- bus = dbus.SessionBus() +- launcher = bus.get_object('org.tichy.launcher', '/Launcher') +- launcher = dbus.Interface(launcher, 'org.tichy.Launcher') +- launcher.Launch(options.launch) +- +- +-if __name__ == '__main__': +- options = parse_options() +- +- if options.launch: +- launch(options.launch, options) +- sys.exit(0) +- +- setup_logging() +- tichy.config.parse(cfg_file=options.cfg_file) +- +- logger.info("init gui") +- tichy.init_gui(None) +- +- # We import all the modules into the plugin directory +- default_plugins_path = '/usr/share/tichy/plugins' +- plugins_dir = tichy.config.get('plugins', 'path', default_plugins_path) +- plugins_dirs = plugins_dir.split(':') +- for plugins_dir in plugins_dirs: +- print plugins_dir +- try: +- logger.info("try to load plugins in %s", plugins_dir) +- tichy.plugins.import_all(plugins_dir) +- except IOError: +- logger.info("failed to load plugins in %s", plugins_dir) +- +- # Set all the default services +- defaults = tichy.config.get('services', 'defaults', None) +- if defaults: +- defaults = defaults.split(',') +- for default in defaults: +- if not default: +- continue +- service, name = default.strip().split(':') +- logger.info("set service %s to %s", service, name) +- tichy.Service.set_default(service, name) +- +- if options.show_services: +- from tichy.service import print_infos +- print_infos() +- sys.exit(0) +- if tichy.config.getboolean('dbus','activated', False): +- logger.info("connect to dbus") +- if options.bus == 'system': +- bus = dbus.SystemBus(mainloop=tichy.mainloop.dbus_loop) +- else: +- bus = dbus.SessionBus(mainloop=tichy.mainloop.dbus_loop) +- bus_name = dbus.service.BusName('org.tichy.launcher', bus) +- +- logger.info("start launcher service") +- launcher = Launcher(bus, '/Launcher') +- +- logger.info("start InitAll") +- InitAll().start() +- +- app_name = tichy.config.get('autolaunch', 'application', None) +- if app_name: +- standalone = tichy.config.getboolean('standalone', 'activated', False) +- for app in tichy.Application.subclasses: +- if app.name == app_name: +- app("None", standalone=standalone).start() +- +- +- logger.info("starting mainloop") +- tichy.mainloop.run() +- logger.info("quit") +diff -ruN paroli.orig/setup.py paroli/setup.py +--- paroli.orig/setup.py 2009-02-02 14:20:01.000000000 +0100 ++++ paroli/setup.py 2009-02-02 14:33:41.000000000 +0100 +@@ -84,14 +84,15 @@ + author_email='mirko@openmoko.org', + package_dir = {'': 'paroli-core'}, + packages = ['tichy', 'tichy.gui_paroli'], +- scripts= ['paroli-scripts/paroli-launcher'], ++ scripts= ['paroli-scripts/parolid'], + # XXX: Those locations may not work on the neo ! + data_files = [('applications', +- ['data/paroli-launcher.desktop', +- 'data/paroli-io.desktop', ++ ['data/parolid.desktop', ++ 'data/paroli-i-o.desktop', + 'data/paroli-contacts.desktop', + 'data/paroli-msgs.desktop', +- 'data/paroli-dialer.desktop']), ++ 'data/paroli-dialer.desktop', ++ 'data/tele.desktop']), + (os.path.join(sys.prefix, 'share/pixmaps/'), + ['data/tichy']), + ('../../etc/paroli/', ['data/paroli.cfg'])] \ diff --git a/phone/paroli/patches/050-adjust-desktop-files.patch b/phone/paroli/patches/050-adjust-desktop-files.patch deleted file mode 100644 index 9d4e55e855..0000000000 --- a/phone/paroli/patches/050-adjust-desktop-files.patch +++ /dev/null @@ -1,121 +0,0 @@ -diff -ruN paroli/data/paroli-contacts.desktop paroli.mod/data/paroli-contacts.desktop ---- paroli/data/paroli-contacts.desktop 2009-01-23 13:35:16.000000000 +0100 -+++ paroli.mod/data/paroli-contacts.desktop 2009-01-23 13:33:12.000000000 +0100 -@@ -1,16 +1,13 @@ - [Desktop Entry] --Name=People --Name[fr]=Calculatrice --Name[it]=Calcolatrice --Name[ru]=Калькулятор --Name[sv]=Miniräknare -+GenericName=Contacts -+Name=Contacts - Encoding=UTF-8 - Version=1.0 --Comment=Paroli Dialer -+Comment=Paroli Contacts - StartupNotify=false - Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Paroli-Contacts --Icon=openmoko-calculator --Terminal=true -+Icon=paroli-contacts.png -+Terminal=false - Type=Application - SingleInstance=true --Categories=GTK;Application;Office; -\ No newline at end of file -+Categories=Telephony;TelephonyTools -diff -ruN paroli/data/paroli-dialer.desktop paroli.mod/data/paroli-dialer.desktop ---- paroli/data/paroli-dialer.desktop 2009-01-23 13:35:16.000000000 +0100 -+++ paroli.mod/data/paroli-dialer.desktop 2009-01-23 13:33:24.000000000 +0100 -@@ -1,16 +1,13 @@ - [Desktop Entry] --Name=Tele --Name[fr]=Calculatrice --Name[it]=Calcolatrice --Name[ru]=Калькулятор --Name[sv]=Miniräknare -+GenericName=Dialer -+Name=Dialer - Encoding=UTF-8 - Version=1.0 - Comment=Paroli Dialer - StartupNotify=false - Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Paroli-Dialer --Icon=openmoko-calculator --Terminal=true -+Icon=paroli-dialer.png -+Terminal=false - Type=Application - SingleInstance=true --Categories=GTK;Application;Office; -\ No newline at end of file -+Categories=Telephony;TelephonyTools -diff -ruN paroli/data/paroli-io.desktop paroli.mod/data/paroli-io.desktop ---- paroli/data/paroli-io.desktop 2009-01-23 13:35:16.000000000 +0100 -+++ paroli.mod/data/paroli-io.desktop 2009-01-23 13:33:33.000000000 +0100 -@@ -1,16 +1,13 @@ - [Desktop Entry] -+GenericName=I/O - Name=I/O --Name[fr]=Calculatrice --Name[it]=Calcolatrice --Name[ru]=Калькулятор --Name[sv]=Miniräknare - Encoding=UTF-8 - Version=1.0 - Comment=Paroli I/O - StartupNotify=false - Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Paroli-I/O --Icon=openmoko-calculator --Terminal=true -+Icon=paroli-i-o.png -+Terminal=false - Type=Application - SingleInstance=true --Categories=GTK;Application;Office; -\ No newline at end of file -+Categories=Telephony;TelephonyTools -diff -ruN paroli/data/paroli-launcher.desktop paroli.mod/data/paroli-launcher.desktop ---- paroli/data/paroli-launcher.desktop 2009-01-23 13:35:16.000000000 +0100 -+++ paroli.mod/data/paroli-launcher.desktop 2009-01-23 13:33:50.000000000 +0100 -@@ -1,11 +1,11 @@ - [Desktop Entry] - Name=PLauncher - TryExec=paroli-launcher --Icon=tichy -+Icon=tichy.png - GenericName=paroli-launcher - Comment=Paroli Launcher - StartupNotify=false - Exec=paroli-launcher - Terminal=false - Type=Application --Categories=Office; -+Categories=Telephony;TelephonyTools -diff -ruN paroli/data/paroli-msgs.desktop paroli.mod/data/paroli-msgs.desktop ---- paroli/data/paroli-msgs.desktop 2009-01-23 13:35:16.000000000 +0100 -+++ paroli.mod/data/paroli-msgs.desktop 2009-01-23 13:37:18.000000000 +0100 -@@ -1,16 +1,13 @@ - [Desktop Entry] --Name=Msgs --Name[fr]=Calculatrice --Name[it]=Calcolatrice --Name[ru]=Калькулятор --Name[sv]=Miniräknare -+GenericName=Messages -+Name=Messages - Encoding=UTF-8 - Version=1.0 - Comment=Paroli Messages - StartupNotify=false - Exec=dbus-send --system --print-reply --dest=org.tichy.launcher /Launcher org.tichy.Launcher.Launch string:Paroli-Msgs --Icon=openmoko-calculator --Terminal=true -+Icon=paroli-msgs.png -+Terminal=false - Type=Application - SingleInstance=true --Categories=GTK;Application;Office; -\ No newline at end of file -+Categories=Telephony;TelephonyTools diff --git a/phone/paroli/patches/100-workaround-bugs.patch b/phone/paroli/patches/100-workaround-bugs.patch deleted file mode 100644 index 23bcbc5431..0000000000 --- a/phone/paroli/patches/100-workaround-bugs.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ruN paroli-20090112.orig/data/paroli-launcher.desktop paroli-20090112/data/paroli-launcher.desktop ---- paroli-20090112.orig/data/paroli-launcher.desktop 2009-01-17 05:05:49.000000000 +0100 -+++ paroli-20090112/data/paroli-launcher.desktop 2009-01-20 21:20:35.000000000 +0100 -@@ -5,7 +5,7 @@ - GenericName=paroli-launcher - Comment=Paroli Launcher - StartupNotify=false --Exec=paroli-launcher -+Exec=sleep 60 && DISPLAY=":0" LD_PRELOAD=/usr/lib/libX11.so paroli-launcher - Terminal=false - Type=Application - Categories=Telephony;TelephonyTools; -- 2.30.2