summaryrefslogtreecommitdiffstats
path: root/deluge/_libtorrent.py
diff options
context:
space:
mode:
authorLibravatarDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 15:52:21 +0100
committerLibravatarDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 15:52:21 +0100
commitd1772d410235592b482e3b08b1863f6624d9fe6b (patch)
treeaccfb4b99c32e5e435089f8023d62e67a6951603 /deluge/_libtorrent.py
parent8181331437b3240c763197ba961cdb106c4f0bdd (diff)
Adding upstream version 2.0.3.upstream/2.0.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/_libtorrent.py')
-rw-r--r--deluge/_libtorrent.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/deluge/_libtorrent.py b/deluge/_libtorrent.py
new file mode 100644
index 0000000..f155fee
--- /dev/null
+++ b/deluge/_libtorrent.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
+#
+# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
+# the additional special exception to link portions of this program with the OpenSSL library.
+# See LICENSE for more details.
+#
+
+"""
+This module is used to handle the importing of libtorrent and also controls
+the minimum versions of libtorrent that this version of Deluge supports.
+
+Example:
+ >>> from deluge._libtorrent import lt
+
+"""
+from __future__ import unicode_literals
+
+from deluge.common import VersionSplit, get_version
+
+try:
+ import deluge.libtorrent as lt
+except ImportError:
+ import libtorrent as lt
+
+REQUIRED_VERSION = '1.1.2.0'
+LT_VERSION = lt.__version__
+
+if VersionSplit(LT_VERSION) < VersionSplit(REQUIRED_VERSION):
+ raise ImportError(
+ 'Deluge %s requires libtorrent >= %s' % (get_version(), REQUIRED_VERSION)
+ )