From c5b3cb47febe33b870d89a3b24ad6101b4213292 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Tue, 6 Dec 2011 01:24:37 -0500 Subject: [PATCH] No longer using os.path.getcwd to lookup addon path --- default.py | 12 ++++++------ resources/lib/gui.py | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/default.py b/default.py index 3206e7c..daf5fe6 100644 --- a/default.py +++ b/default.py @@ -2,9 +2,10 @@ # Copyright (c) 2010 Correl J. Roush import os +import sys import xbmc -import xbmcgui import xbmcaddon + __scriptname__ = "Transmission-XBMC" __author__ = "Correl Roush " __url__ = "http://github.com/correl/Transmission-XBMC" @@ -13,18 +14,17 @@ __credits__ = "" __version__ = "0.5.2" __XBMC_Revision__ = "30377" -BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( os.getcwd(), 'resources', 'lib' ) ) -sys.path.append (BASE_RESOURCE_PATH) - __settings__ = xbmcaddon.Addon(id='script.transmission') - __language__ = __settings__.getLocalizedString +BASE_RESOURCE_PATH = xbmc.translatePath( os.path.join( __settings__.getAddonInfo('path'), 'resources', 'lib' ) ) +sys.path.append (BASE_RESOURCE_PATH) + KEY_BUTTON_BACK = 275 KEY_KEYBOARD_ESC = 61467 if __name__ == '__main__': from gui import TransmissionGUI - w = TransmissionGUI("script-Transmission-main.xml",os.getcwd() ,"Default") + w = TransmissionGUI("script-Transmission-main.xml", __settings__.getAddonInfo('path') , "Default") w.doModal() del w diff --git a/resources/lib/gui.py b/resources/lib/gui.py index 1cc5742..a59e066 100644 --- a/resources/lib/gui.py +++ b/resources/lib/gui.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- # Copyright (c) 2010 Correl J. Roush -import os import sys import base64 import urllib2 @@ -184,7 +183,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog): if (controlID == 120): # A torrent was chosen, show details item = list.getSelectedItem() - w = TorrentInfoGUI("script-Transmission-details.xml",os.getcwd() ,"Default") + w = TorrentInfoGUI("script-Transmission-details.xml", __settings__.getAddonInfo('path') ,"Default") w.setTorrent(self.transmission, int(item.getProperty('TorrentID'))) w.doModal() del w