Mercurial > libervia-backend
view src/sat.sh @ 773:eac23b1aad90
core: dynamics menus refactoring:
- menu now use generic callback system, with extra data
- asyncMenuCall is removed in favor of launchAction
- menu_id (== callback_id) is used to identify menu instead of category/name/type tuple
- i18n is managed throught deferred translation, and returned with _i18n suffix
e.g.: menu (D_('File'), D_('Open')): (u'File', u'Open') is menu_path, (u'Fichier', u'Ouvrir') is french menu_path_i18n.
- type actually can have the following values:
- NORMAL: classical menu
- JID_CONTEXT: contextual menu, used with any jid
- ROSTER_JID_CONTEXT: like JID_CONTEXT, but restricted to jids in roster.
- ROSTER_GROUP_CONTEXT: contextual menu, use with groups
- security_limit is used, in the same way as for parameters
- when using importMenu, callback can be an actual callback, or one already registered with registerCallback
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 29 Dec 2013 17:10:14 +0100 |
parents | 952322b1d490 |
children | cbf4122baae7 |
line wrap: on
line source
#!/bin/sh #if there is one argument which is "stop", then we kill SàT DEBUG="" if [ $# -eq 1 ];then if [ $1 = "stop" ];then echo "Terminating Salut à Toi" pkill -f "twistd.*/sat.tac" exit 0 fi if [ $1 = "debug" ];then echo "Launching SàT in debug mode" DEBUG="--debug" fi fi NAME='sat' PYTHON='python' #We use python to parse config files eval `"$PYTHON" << PYTHONEND from ConfigParser import SafeConfigParser from os.path import expanduser, join import sys config = SafeConfigParser(defaults={'local_dir':'~/.sat', 'pid_dir':'/tmp', 'log_dir':'%(local_dir)s'}) try: config.read(map(expanduser, ['/etc/sat.conf', '~/sat.conf', '~/.sat.conf', 'sat.conf', '.sat.conf'])) except: print ("echo \"/!\\ Can't read main config ! Please check the syntax\";") print ("exit 1") sys.exit() env=[] env.append("LOCAL_DIR='%s'" % join(expanduser(config.get('DEFAULT', 'local_dir')),'')) env.append("PID_DIR='%s'" % join(expanduser(config.get('DEFAULT', 'pid_dir')),'')) env.append("LOG_DIR='%s'" % join(expanduser(config.get('DEFAULT', 'pid_dir')),'')) print ";".join(env) PYTHONEND ` PID_FILE="$PID_DIR$NAME.pid" LOG_FILE="$LOCAL_DIR$NAME.log" DAEMON="n" MAIN_OPTIONS="-${DAEMON}oy" TAP_PATH="./" TAP_FILE="$NAME.tac" #Don't change the next line AUTO_OPTIONS="" ADDITIONAL_OPTIONS="--pidfile $PID_FILE --logfile $LOG_FILE $AUTO_OPTIONS $DEBUG" log_dir=`dirname "$LOG_FILE"` if [ ! -d $log_dir ] ; then mkdir $log_dir fi twistd $MAIN_OPTIONS $TAP_PATH$TAP_FILE $ADDITIONAL_OPTIONS