module over system

pull/1/head
DiMartinoXBMC 2015-08-02 16:48:41 +03:00
parent b6a56501ec
commit 2198b927b0
1 changed files with 7 additions and 8 deletions

View File

@ -58,21 +58,20 @@ class Libtorrent:
sys.exit(1)
try:
import libtorrent
print '[Torrenter v2]: Imported libtorrent v' + libtorrent.version + ' from system'
except Exception, e:
print '[Torrenter v2]: Error importing from system. Exception: ' + str(e)
from python_libtorrent import get_libtorrent
libtorrent=get_libtorrent()
log('Imported libtorrent v%s from python_libtorrent/%s' %(libtorrent.version, self.platform['system']))
except Exception, e:
log('Error importing python_libtorrent.%s. Exception: %s' %(self.platform['system'], str(e)))
import libtorrent
try:
log('Imported libtorrent v' + libtorrent.version + ' from system')
self.lt = libtorrent
del libtorrent
print '[Torrenter v2]: Imported libtorrent v' + self.lt.version + ' from python_libtorrent.' + self.platform[
'system']
except Exception, e:
print '[Torrenter v2]: Error importing python_libtorrent.' + self.platform['system'] + '. Exception: ' + str(e)
log('Error importing from system. Exception: ' + str(e))
xbmcgui.Dialog().ok(Localization.localize('Python-Libtorrent Not Found'),
Localization.localize(self.platform["message"][0]),
Localization.localize(self.platform["message"][1]))