From 1495a0f9756d8d0a87e442c6ad70c941e69daa7d Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Sun, 12 Jul 2015 18:54:43 +0300 Subject: [PATCH] fixes --- platform_pulsar.py | 2 +- python_libtorrent/__init__.py | 7 ++++--- python_libtorrent/functions.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/platform_pulsar.py b/platform_pulsar.py index 0b6ada1..5e230bf 100644 --- a/platform_pulsar.py +++ b/platform_pulsar.py @@ -69,7 +69,7 @@ def get_platform(): else: ret["system"] = 'android_x86' ret["message"] = ['Please contact DiMartino on kodi.tv forum. We compiled python-libtorrent for Android,', - 'but we need your help with some tests on diffrient processeors.'] + 'but we need your help with some tests on different processors.'] elif ret["os"] == "darwin": ret["system"] = 'darwin' ret["message"] = ['It is possible to compile python-libtorrent for OS X.', diff --git a/python_libtorrent/__init__.py b/python_libtorrent/__init__.py index c15de41..a01c1cd 100644 --- a/python_libtorrent/__init__.py +++ b/python_libtorrent/__init__.py @@ -17,8 +17,6 @@ libtorrent=None platform = get_platform() dirname = os.path.join(xbmc.translatePath('special://temp'), 'xbmcup', 'script.module.libtorrent', 'python_libtorrent') -#dirname = os.path.join(xbmc.translatePath('special://home'), 'addons', 'script.module.libtorrent', -# 'python_libtorrent') dest_path = os.path.join(dirname, platform['system']) sys.path.insert(0, dest_path) @@ -50,7 +48,10 @@ try: fp, pathname, description = imp.find_module('libtorrent', path_list) log('fp = ' + str(fp)) log('pathname = ' + str(pathname)) - libtorrent = imp.load_module('libtorrent', fp, pathname, description) + try: + libtorrent = imp.load_module('libtorrent', fp, pathname, description) + finally: + if fp: fp.close() log('Imported libtorrent v' + libtorrent.version + ' from ' + dest_path) diff --git a/python_libtorrent/functions.py b/python_libtorrent/functions.py index eeb433e..5b1fd2c 100644 --- a/python_libtorrent/functions.py +++ b/python_libtorrent/functions.py @@ -34,7 +34,7 @@ class DownloaderClass(): text = 'Failed download %s!' % libname xbmc.executebuiltin("XBMC.Notification(%s,%s,%s,%s)" % (__scriptname__,text,750,__icon__)) else: - x=xbmcvfs.copy(os.path.join(self.dest_path, 'libtorrent.so', dest)) + x=xbmcvfs.copy(os.path.join(self.dest_path, 'libtorrent.so'), dest) return True def log(msg):