Module: deluge Branch: 1.3-stable Commit: eb309813eac7b95ffd76877d880c49d2639bae3f
Author: Calum Lind <calumlind+del...@gmail.com> Date: Sat Jul 9 14:00:29 2011 +0100 Fix #1505: Add libtorrent info to --version output --- deluge/main.py | 9 +++++++-- deluge/ui/ui.py | 8 +++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/deluge/main.py b/deluge/main.py index 4b32e79..b370c65 100644 --- a/deluge/main.py +++ b/deluge/main.py @@ -48,6 +48,11 @@ import deluge.common import deluge.configmanager import deluge.error +try: + from deluge._libtorrent import lt + lt_version = "\nlibtorrent: %s" % lt.version +except ImportError: + lt_version = "" def start_ui(): """Entry point for ui script""" @@ -55,7 +60,7 @@ def start_ui(): # Setup the argument parser parser = OptionParser(usage="%prog [options] [actions]", - version=deluge.common.get_version()) + version= "%prog: " + deluge.common.get_version() + lt_version) parser.add_option("-u", "--ui", dest="ui", help="""The UI that you wish to launch. The UI choices are:\n @@ -130,7 +135,7 @@ def start_daemon(): # Setup the argument parser parser = OptionParser(usage="%prog [options] [actions]", - version=deluge.common.get_version()) + version= "%prog: " + deluge.common.get_version() + lt_version) parser.add_option("-p", "--port", dest="port", help="Port daemon will listen on", action="store", type="int") parser.add_option("-i", "--interface", dest="interface", diff --git a/deluge/ui/ui.py b/deluge/ui/ui.py index b210e2d..012a272 100644 --- a/deluge/ui/ui.py +++ b/deluge/ui/ui.py @@ -39,6 +39,12 @@ import deluge.configmanager import deluge.log import os +try: + from deluge._libtorrent import lt + lt_version = "\nlibtorrent: %s" % lt.version +except ImportError: + lt_version = "" + DEFAULT_PREFS = { "default_ui": "gtk" } @@ -54,7 +60,7 @@ class _UI(object): usage="%prog [options] [actions]", - self.__parser = OptionParser(version=deluge.common.get_version()) + self.__parser = OptionParser(version="%prog: " + deluge.common.get_version() + lt_version) group = OptionGroup(self.__parser, "Common Options") group.add_option("-c", "--config", dest="config", -- You received this message because you are subscribed to the Google Groups "deluge-commit" group. To post to this group, send email to deluge-commit@googlegroups.com. To unsubscribe from this group, send email to deluge-commit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/deluge-commit?hl=en.