mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
Use a constant for versions
This commit is contained in:
parent
4e79ed8124
commit
12f7345d0c
4 changed files with 10 additions and 7 deletions
|
@ -25,6 +25,7 @@ except ImportError:
|
||||||
import libtorrent as lt
|
import libtorrent as lt
|
||||||
|
|
||||||
REQUIRED_VERSION = '1.1.2.0'
|
REQUIRED_VERSION = '1.1.2.0'
|
||||||
|
LT_VERSION = lt.__version__
|
||||||
|
|
||||||
if VersionSplit(lt.__version__) < VersionSplit(REQUIRED_VERSION):
|
if VersionSplit(LT_VERSION) < VersionSplit(REQUIRED_VERSION):
|
||||||
raise ImportError('Deluge %s requires libtorrent >= %s' % (get_version(), REQUIRED_VERSION))
|
raise ImportError('Deluge %s requires libtorrent >= %s' % (get_version(), REQUIRED_VERSION))
|
||||||
|
|
|
@ -24,7 +24,7 @@ from twisted.web.client import getPage
|
||||||
import deluge.common
|
import deluge.common
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
from deluge import path_chooser_common
|
from deluge import path_chooser_common
|
||||||
from deluge._libtorrent import lt
|
from deluge._libtorrent import lt, LT_VERSION
|
||||||
from deluge.common import PY2
|
from deluge.common import PY2
|
||||||
from deluge.configmanager import ConfigManager, get_config_dir
|
from deluge.configmanager import ConfigManager, get_config_dir
|
||||||
from deluge.core.alertmanager import AlertManager
|
from deluge.core.alertmanager import AlertManager
|
||||||
|
@ -97,6 +97,8 @@ SESSION_RATES_MAPPING = {
|
||||||
'upload_rate': 'net.sent_bytes',
|
'upload_rate': 'net.sent_bytes',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DELUGE_VER = deluge.common.get_version()
|
||||||
|
|
||||||
|
|
||||||
class Core(component.Component):
|
class Core(component.Component):
|
||||||
def __init__(self, listen_interface=None, read_only_config_keys=None):
|
def __init__(self, listen_interface=None, read_only_config_keys=None):
|
||||||
|
@ -1058,7 +1060,7 @@ class Core(component.Component):
|
||||||
:rtype: string
|
:rtype: string
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return lt.__version__
|
return LT_VERSION
|
||||||
|
|
||||||
@export
|
@export
|
||||||
def get_completion_paths(self, args):
|
def get_completion_paths(self, args):
|
||||||
|
|
|
@ -89,8 +89,8 @@ argparse.ArgumentParser.set_default_subparser = set_default_subparser
|
||||||
def get_version():
|
def get_version():
|
||||||
version_str = '%s\n' % (common.get_version())
|
version_str = '%s\n' % (common.get_version())
|
||||||
try:
|
try:
|
||||||
from deluge._libtorrent import lt
|
from deluge._libtorrent import LT_VERSION
|
||||||
version_str += 'libtorrent: %s\n' % lt.__version__
|
version_str += 'libtorrent: %s\n' % LT_VERSION
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
version_str += 'Python: %s\n' % platform.python_version()
|
version_str += 'Python: %s\n' % platform.python_version()
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -360,8 +360,8 @@ class Build(_build):
|
||||||
# Run all sub-commands (at least those that need to be run).
|
# Run all sub-commands (at least those that need to be run).
|
||||||
_build.run(self)
|
_build.run(self)
|
||||||
try:
|
try:
|
||||||
from deluge._libtorrent import lt
|
from deluge._libtorrent import LT_VERSION
|
||||||
print('Info: Found libtorrent ({}) installed.'.format(lt.__version__))
|
print('Info: Found libtorrent ({}) installed.'.format(LT_VERSION))
|
||||||
except ImportError as ex:
|
except ImportError as ex:
|
||||||
print('Warning: libtorrent (libtorrent-rasterbar) not found: %s' % ex)
|
print('Warning: libtorrent (libtorrent-rasterbar) not found: %s' % ex)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue