No longer using os.path.getcwd to lookup addon path

This commit is contained in:
Correl Roush 2011-12-06 01:24:37 -05:00
parent e40529ca65
commit c5b3cb47fe
2 changed files with 7 additions and 8 deletions

View file

@ -2,9 +2,10 @@
# Copyright (c) 2010 Correl J. Roush # Copyright (c) 2010 Correl J. Roush
import os import os
import sys
import xbmc import xbmc
import xbmcgui
import xbmcaddon import xbmcaddon
__scriptname__ = "Transmission-XBMC" __scriptname__ = "Transmission-XBMC"
__author__ = "Correl Roush <correl@gmail.com>" __author__ = "Correl Roush <correl@gmail.com>"
__url__ = "http://github.com/correl/Transmission-XBMC" __url__ = "http://github.com/correl/Transmission-XBMC"
@ -13,18 +14,17 @@ __credits__ = ""
__version__ = "0.5.2" __version__ = "0.5.2"
__XBMC_Revision__ = "30377" __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') __settings__ = xbmcaddon.Addon(id='script.transmission')
__language__ = __settings__.getLocalizedString __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_BUTTON_BACK = 275
KEY_KEYBOARD_ESC = 61467 KEY_KEYBOARD_ESC = 61467
if __name__ == '__main__': if __name__ == '__main__':
from gui import TransmissionGUI 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() w.doModal()
del w del w

View file

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (c) 2010 Correl J. Roush # Copyright (c) 2010 Correl J. Roush
import os
import sys import sys
import base64 import base64
import urllib2 import urllib2
@ -184,7 +183,7 @@ class TransmissionGUI(xbmcgui.WindowXMLDialog):
if (controlID == 120): if (controlID == 120):
# A torrent was chosen, show details # A torrent was chosen, show details
item = list.getSelectedItem() 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.setTorrent(self.transmission, int(item.getProperty('TorrentID')))
w.doModal() w.doModal()
del w del w