2005-04-01 01:26:05 +02:00
|
|
|
#!/bin/sh
|
|
|
|
''':'
|
|
|
|
exec python -OOtt "$0" ${1+"$@"}
|
|
|
|
' '''
|
2003-10-22 20:45:13 +02:00
|
|
|
##
|
|
|
|
## Gajim Team:
|
2005-01-07 22:52:38 +01:00
|
|
|
## - Yann Le Boulanger <asterix@lagaule.org>
|
2004-06-18 11:25:15 +02:00
|
|
|
## - Vincent Hanquez <tab@snarc.org>
|
2003-10-22 20:45:13 +02:00
|
|
|
##
|
2005-01-07 22:52:38 +01:00
|
|
|
## Copyright (C) 2003-2005 Gajim Team
|
2003-10-22 20:45:13 +02:00
|
|
|
##
|
|
|
|
## This program 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; version 2 only.
|
|
|
|
##
|
|
|
|
## This program 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.
|
|
|
|
##
|
|
|
|
|
|
|
|
import logging
|
|
|
|
logging.basicConfig()
|
|
|
|
|
|
|
|
import common
|
2004-12-19 20:40:58 +01:00
|
|
|
import Core
|
2003-10-22 20:45:13 +02:00
|
|
|
|
2004-05-17 01:47:14 +02:00
|
|
|
from common import i18n
|
|
|
|
i18n.init()
|
|
|
|
_ = i18n._
|
|
|
|
|
2005-02-28 13:47:23 +01:00
|
|
|
import getopt
|
|
|
|
import sys
|
|
|
|
import signal
|
2004-07-17 17:31:47 +02:00
|
|
|
|
|
|
|
def usage():
|
|
|
|
print "usage :", sys.argv[0], ' [OPTION]'
|
|
|
|
print " -c\tlaunch Gajim as a client of a Gajim server"
|
|
|
|
print " -h, --help\tdisplay this help and exit"
|
|
|
|
|
|
|
|
try:
|
|
|
|
opts, args = getopt.getopt(sys.argv[1:], "ch", ["help"])
|
|
|
|
except getopt.GetoptError:
|
|
|
|
# print help information and exit:
|
|
|
|
usage()
|
|
|
|
sys.exit(2)
|
|
|
|
mode = 'server'
|
|
|
|
for o, a in opts:
|
|
|
|
if o == '-c':
|
|
|
|
mode = 'client'
|
|
|
|
if o in ("-h", "--help"):
|
|
|
|
usage()
|
|
|
|
sys.exit()
|
|
|
|
|
2005-02-28 13:47:23 +01:00
|
|
|
# ^C exits the application
|
|
|
|
signal.signal(signal.SIGINT, signal.SIG_DFL)
|
|
|
|
|
2004-12-19 20:40:58 +01:00
|
|
|
Core.core.start(mode)
|
2004-05-17 01:47:14 +02:00
|
|
|
print _("Core Stopped")
|
2005-04-01 01:26:05 +02:00
|
|
|
|
|
|
|
|