From 3ca766bf0e9eef6800797006c91d668261a85e2a Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Sun, 28 Jun 2015 13:47:37 +0300 Subject: [PATCH] script.module.libtorrent update is comming --- Libtorrent.py | 17 +++++++++++++---- platform_pulsar.py | 5 +---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Libtorrent.py b/Libtorrent.py index d7047af..018aaa7 100644 --- a/Libtorrent.py +++ b/Libtorrent.py @@ -24,7 +24,7 @@ import os import urllib2 import hashlib import re -import sys +# import sys from StringIO import StringIO import gzip @@ -101,7 +101,7 @@ class Libtorrent: print 'Error importing python_libtorrent.' + system + '. Exception: ' + str(e) pass #from ctypes import * - #cdll.LoadLibrary(dirname + '/libtorrent-rasterbar.so.7')''' + #cdll.LoadLibrary(dirname + '/libtorrent-rasterbar.so.7') self.platform = get_platform() @@ -124,12 +124,21 @@ class Libtorrent: 'system'] except Exception, 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: self.lt = 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'), Localization.localize(self.platform["message"][0]), Localization.localize(self.platform["message"][1])) diff --git a/platform_pulsar.py b/platform_pulsar.py index 8ceba7a..a3bac6c 100644 --- a/platform_pulsar.py +++ b/platform_pulsar.py @@ -59,7 +59,4 @@ def get_platform(): ret["message"] = ['It is NOT possible to compile python-libtorrent for iOS.', 'But you can use torrent-client control functions.'] - return ret - - -PLATFORM = get_platform() + return ret \ No newline at end of file