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:
Andrew Resch 2008-12-10 23:30:09 +00:00
parent 831ac110a8
commit 55e694e80b
7 changed files with 37 additions and 13 deletions

View File

@ -28,7 +28,13 @@
import gobject
import deluge.component as component
import deluge.libtorrent as lt
try:
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
class AlertManager(component.Component):

View File

@ -26,9 +26,12 @@
import os
try:
import libtorrent as lt
except ImportError:
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
from deluge.configmanager import ConfigManager
from deluge.log import LOG as log

View File

@ -40,9 +40,12 @@ import threading
import socket
try:
import libtorrent as lt
except ImportError:
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.common
import deluge.component as component

View File

@ -30,9 +30,12 @@ import cPickle
import shutil
try:
import libtorrent as lt
except ImportError:
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
import deluge.core.torrentmanager
from deluge.log import LOG as log

View File

@ -28,9 +28,12 @@ import threading
import gobject
try:
import libtorrent as lt
except ImportError:
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.common
import deluge.component as component

View File

@ -30,9 +30,12 @@ import time
from urlparse import urlparse
try:
import libtorrent as lt
except ImportError:
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.component as component
from deluge.configmanager import ConfigManager

View File

@ -34,9 +34,12 @@ import shutil
import gobject
try:
import libtorrent as lt
except ImportError:
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.component as component