Change libtorrent import behaviour to first try importing deluge.libtorrent and then libtorrent. It will now also raise an ImportError if libtorrent version is not 0.14.
This commit is contained in:
parent
cbb7c6119d
commit
e7914ed520
@ -29,9 +29,12 @@ import gobject
|
|||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
try:
|
try:
|
||||||
import libtorrent as lt
|
|
||||||
except ImportError:
|
|
||||||
import deluge.libtorrent as lt
|
import deluge.libtorrent as lt
|
||||||
|
except ImportError:
|
||||||
|
import libtorrent as lt
|
||||||
|
if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14):
|
||||||
|
raise ImportError("This version of Deluge requires libtorrent 0.14!")
|
||||||
|
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
|
||||||
class AlertManager(component.Component):
|
class AlertManager(component.Component):
|
||||||
|
|||||||
@ -26,9 +26,12 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import libtorrent as lt
|
|
||||||
except ImportError:
|
|
||||||
import deluge.libtorrent as lt
|
import deluge.libtorrent as lt
|
||||||
|
except ImportError:
|
||||||
|
import libtorrent as lt
|
||||||
|
if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14):
|
||||||
|
raise ImportError("This version of Deluge requires libtorrent 0.14!")
|
||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
from deluge.configmanager import ConfigManager
|
from deluge.configmanager import ConfigManager
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
|||||||
@ -39,9 +39,12 @@ import threading
|
|||||||
import socket
|
import socket
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import libtorrent as lt
|
|
||||||
except ImportError:
|
|
||||||
import deluge.libtorrent as lt
|
import deluge.libtorrent as lt
|
||||||
|
except ImportError:
|
||||||
|
import libtorrent as lt
|
||||||
|
if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14):
|
||||||
|
raise ImportError("This version of Deluge requires libtorrent 0.14!")
|
||||||
|
|
||||||
|
|
||||||
import deluge.configmanager
|
import deluge.configmanager
|
||||||
import deluge.common
|
import deluge.common
|
||||||
|
|||||||
@ -30,9 +30,12 @@ import cPickle
|
|||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import libtorrent as lt
|
|
||||||
except ImportError:
|
|
||||||
import deluge.libtorrent as lt
|
import deluge.libtorrent as lt
|
||||||
|
except ImportError:
|
||||||
|
import libtorrent as lt
|
||||||
|
if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14):
|
||||||
|
raise ImportError("This version of Deluge requires libtorrent 0.14!")
|
||||||
|
|
||||||
from deluge.configmanager import ConfigManager
|
from deluge.configmanager import ConfigManager
|
||||||
import deluge.core.torrentmanager
|
import deluge.core.torrentmanager
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
|
|||||||
@ -28,9 +28,12 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import libtorrent as lt
|
|
||||||
except ImportError:
|
|
||||||
import deluge.libtorrent as lt
|
import deluge.libtorrent as lt
|
||||||
|
except ImportError:
|
||||||
|
import libtorrent as lt
|
||||||
|
if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14):
|
||||||
|
raise ImportError("This version of Deluge requires libtorrent 0.14!")
|
||||||
|
|
||||||
import deluge.common
|
import deluge.common
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
from deluge.configmanager import ConfigManager
|
from deluge.configmanager import ConfigManager
|
||||||
|
|||||||
@ -33,9 +33,12 @@ import time
|
|||||||
import gobject
|
import gobject
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import libtorrent as lt
|
|
||||||
except ImportError:
|
|
||||||
import deluge.libtorrent as lt
|
import deluge.libtorrent as lt
|
||||||
|
except ImportError:
|
||||||
|
import libtorrent as lt
|
||||||
|
if not (libtorrent.version_major == 0 and libtorrent.version_minor == 14):
|
||||||
|
raise ImportError("This version of Deluge requires libtorrent 0.14!")
|
||||||
|
|
||||||
|
|
||||||
import deluge.common
|
import deluge.common
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user