From 70d01a0043301196d66d2ab0f07c280dafb43ca8 Mon Sep 17 00:00:00 2001 From: DiMartinoXBMC Date: Sun, 28 Jun 2015 16:27:19 +0300 Subject: [PATCH] delete system import --- python_libtorrent/__init__.py | 37 ++++++++++++++--------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/python_libtorrent/__init__.py b/python_libtorrent/__init__.py index e788b41..be925f9 100644 --- a/python_libtorrent/__init__.py +++ b/python_libtorrent/__init__.py @@ -11,27 +11,20 @@ platform = get_platform() print '[script.module.libtorrent]: platform ' + str(platform) try: - import libtorrent + #dirname = os.path.join(xbmc.translatePath('special://home'), 'addons', 'script.module.libtorrent', + # 'python_libtorrent', platform['system']) + #sys.path.insert(0, dirname) + if platform['system'] == 'darwin': + from darwin.libtorrent import * + elif platform['system'] == 'linux_x86': + from linux_x86.libtorrent import * + elif platform['system'] == 'linux_x86_64': + from linux_x86_64.libtorrent import * + elif platform['system'] == 'windows': + from windows.libtorrent import * - print '[script.module.libtorrent]: Imported libtorrent v' + libtorrent.version + ' from system' + #print '[script.module.libtorrent]: Imported libtorrent v' + libtorrent.version + ' from python_libtorrent.' + platform[ + # 'system'] except Exception, e: - print '[script.module.libtorrent]: Error importing from system. Exception: ' + str(e) - - try: - #dirname = os.path.join(xbmc.translatePath('special://home'), 'addons', 'script.module.libtorrent', - # 'python_libtorrent', platform['system']) - #sys.path.insert(0, dirname) - if platform['system'] == 'darwin': - from darwin.libtorrent import * - elif platform['system'] == 'linux_x86': - from linux_x86.libtorrent import * - elif platform['system'] == 'linux_x86_64': - from linux_x86_64.libtorrent import * - elif platform['system'] == 'windows': - from windows.libtorrent import * - - #print '[script.module.libtorrent]: Imported libtorrent v' + libtorrent.version + ' from python_libtorrent.' + platform[ - # 'system'] - except Exception, e: - print '[script.module.libtorrent]: Error importing python_libtorrent.' + platform['system'] + '. Exception: ' + str(e) - pass \ No newline at end of file + print '[script.module.libtorrent]: Error importing python_libtorrent.' + platform['system'] + '. Exception: ' + str(e) + pass \ No newline at end of file