summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorZach Tibbitts <zach@collegegeek.org>2007-03-05 20:53:22 +0000
committerZach Tibbitts <zach@collegegeek.org>2007-03-05 20:53:22 +0000
commit3b4c0f2fb97ae90170bf6a522b474ccaaf340ec3 (patch)
treee8a3c2e65ba8b1ef868088ff7f78b343d74696cb /scripts
parent3ec11abda7e2b3547386a3e855c53e9bd3e520b1 (diff)
downloaddeluge-3b4c0f2fb97ae90170bf6a522b474ccaaf340ec3.tar.gz
deluge-3b4c0f2fb97ae90170bf6a522b474ccaaf340ec3.tar.bz2
deluge-3b4c0f2fb97ae90170bf6a522b474ccaaf340ec3.zip
fix launcher to start translations
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/deluge27
1 files changed, 13 insertions, 14 deletions
diff --git a/scripts/deluge b/scripts/deluge
index a0bddb9f5..1868cdac2 100755
--- a/scripts/deluge
+++ b/scripts/deluge
@@ -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: