script.module.libtorrent update is comming

pull/1/head
DiMartinoXBMC 2015-06-28 13:47:37 +03:00
parent 01a4599136
commit 3ca766bf0e
2 changed files with 14 additions and 8 deletions

View File

@ -24,7 +24,7 @@ import os
import urllib2 import urllib2
import hashlib import hashlib
import re import re
import sys # import sys
from StringIO import StringIO from StringIO import StringIO
import gzip import gzip
@ -101,7 +101,7 @@ class Libtorrent:
print 'Error importing python_libtorrent.' + system + '. Exception: ' + str(e) print 'Error importing python_libtorrent.' + system + '. Exception: ' + str(e)
pass pass
#from ctypes import * #from ctypes import *
#cdll.LoadLibrary(dirname + '/libtorrent-rasterbar.so.7')''' #cdll.LoadLibrary(dirname + '/libtorrent-rasterbar.so.7')
self.platform = get_platform() self.platform = get_platform()
@ -124,12 +124,21 @@ class Libtorrent:
'system'] 'system']
except Exception, e: except Exception, e:
print 'Error importing python_libtorrent.' + self.platform['system'] + '. Exception: ' + str(e) print 'Error importing python_libtorrent.' + self.platform['system'] + '. Exception: ' + str(e)
pass pass'''
self.platform = get_platform()
try:
import libtorrent
except:
import python_libtorrent as libtorrent
try: try:
self.lt = libtorrent self.lt = libtorrent
del libtorrent del libtorrent
except: print 'Imported libtorrent v' + self.lt.version + ' from python_libtorrent.' + self.platform[
'system']
except Exception, e:
print 'Error importing python_libtorrent.' + self.platform['system'] + '. Exception: ' + str(e)
xbmcgui.Dialog().ok(Localization.localize('Python-Libtorrent Not Found'), xbmcgui.Dialog().ok(Localization.localize('Python-Libtorrent Not Found'),
Localization.localize(self.platform["message"][0]), Localization.localize(self.platform["message"][0]),
Localization.localize(self.platform["message"][1])) Localization.localize(self.platform["message"][1]))

View File

@ -60,6 +60,3 @@ def get_platform():
'But you can use torrent-client control functions.'] 'But you can use torrent-client control functions.']
return ret return ret
PLATFORM = get_platform()