mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 05:47:50 +00:00
fix launcher to start translations
This commit is contained in:
parent
3ec11abda7
commit
3b4c0f2fb9
@ -27,13 +27,9 @@
|
|||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
import sys
|
import sys
|
||||||
import os, os.path
|
import os, os.path
|
||||||
|
import gettext
|
||||||
parser = OptionParser(usage="%prog [options] [actions]", version="%prog 0.4.90.0")
|
import deluge, deluge.dcommon, deluge.delugegtk
|
||||||
parser.add_option("--tray", dest="tray", help="start Deluge hidden in system tray",
|
|
||||||
metavar="TRAY", action="store_true")
|
|
||||||
try:
|
try:
|
||||||
(options, args) = parser.parse_args()
|
|
||||||
|
|
||||||
import dbus
|
import dbus
|
||||||
dbus_version = getattr(dbus, 'version', (0,0,0))
|
dbus_version = getattr(dbus, 'version', (0,0,0))
|
||||||
if dbus_version >= (0,41,0) and dbus_version < (0,80,0):
|
if dbus_version >= (0,41,0) and dbus_version < (0,80,0):
|
||||||
@ -46,6 +42,15 @@ try:
|
|||||||
except: dbus_imported = False
|
except: dbus_imported = False
|
||||||
else: dbus_imported = True
|
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:
|
if dbus_imported:
|
||||||
bus = dbus.SessionBus()
|
bus = dbus.SessionBus()
|
||||||
|
|
||||||
@ -54,10 +59,7 @@ if dbus_imported:
|
|||||||
interface = None
|
interface = None
|
||||||
|
|
||||||
if not "org.deluge_torrent.Deluge" in dbus_objects:
|
if not "org.deluge_torrent.Deluge" in dbus_objects:
|
||||||
print "no existing Deluge session"
|
print "no existing Deluge session"
|
||||||
import deluge, deluge.delugegtk
|
|
||||||
import gettext
|
|
||||||
gettext.install('deluge')
|
|
||||||
|
|
||||||
interface = deluge.delugegtk.DelugeGTK()
|
interface = deluge.delugegtk.DelugeGTK()
|
||||||
for arg in args:
|
for arg in args:
|
||||||
@ -82,13 +84,10 @@ if dbus_imported:
|
|||||||
print "Error,", arg, " does not seem to be a .torrent file"
|
print "Error,", arg, " does not seem to be a .torrent file"
|
||||||
else:
|
else:
|
||||||
print "no existing Deluge session"
|
print "no existing Deluge session"
|
||||||
import deluge, deluge.delugegtk
|
|
||||||
import gettext
|
|
||||||
gettext.install('deluge')
|
|
||||||
|
|
||||||
interface = deluge.delugegtk.DelugeGTK()
|
interface = deluge.delugegtk.DelugeGTK()
|
||||||
for arg in args:
|
for arg in args:
|
||||||
apath = os.path.abspath(arg)
|
apath = os.path.abspath(arg)
|
||||||
if apath.endswith(".torrent"):
|
if apath.endswith(".torrent"):
|
||||||
interface.external_add_torrent(apath)
|
interface.external_add_torrent(apath)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user