fix launcher to start translations

This commit is contained in:
Zach Tibbitts 2007-03-05 20:53:22 +00:00
parent 3ec11abda7
commit 3b4c0f2fb9
1 changed files with 13 additions and 14 deletions

View File

@ -27,13 +27,9 @@
from optparse import OptionParser
import sys
import os, os.path
parser = OptionParser(usage="%prog [options] [actions]", version="%prog 0.4.90.0")
parser.add_option("--tray", dest="tray", help="start Deluge hidden in system tray",
metavar="TRAY", action="store_true")
import gettext
import deluge, deluge.dcommon, deluge.delugegtk
try:
(options, args) = parser.parse_args()
import dbus
dbus_version = getattr(dbus, 'version', (0,0,0))
if dbus_version >= (0,41,0) and dbus_version < (0,80,0):
@ -46,6 +42,15 @@ try:
except: dbus_imported = False
else: dbus_imported = True
parser = OptionParser(usage="%prog [options] [actions]", version=deluge.dcommon.PROGRAM_VERSION)
parser.add_option("--tray", dest="tray", help="start Deluge hidden in system tray",
metavar="TRAY", action="store_true")
(options, args) = parser.parse_args()
gettext.install('deluge', localedir=os.path.join(deluge.dcommon.INSTALL_PREFIX, 'share', 'locale'))
if dbus_imported:
bus = dbus.SessionBus()
@ -54,10 +59,7 @@ if dbus_imported:
interface = None
if not "org.deluge_torrent.Deluge" in dbus_objects:
print "no existing Deluge session"
import deluge, deluge.delugegtk
import gettext
gettext.install('deluge')
print "no existing Deluge session"
interface = deluge.delugegtk.DelugeGTK()
for arg in args:
@ -82,13 +84,10 @@ if dbus_imported:
print "Error,", arg, " does not seem to be a .torrent file"
else:
print "no existing Deluge session"
import deluge, deluge.delugegtk
import gettext
gettext.install('deluge')
interface = deluge.delugegtk.DelugeGTK()
for arg in args:
apath = os.path.abspath(arg)
apath = os.path.abspath(arg)
if apath.endswith(".torrent"):
interface.external_add_torrent(apath)
else: