2009-02-17, 13:24
using os.getcwd() in conjunction with the recommended url style path divider '/' creates a path with mixed dividers.
ie.
DIR_HOME = os.getcwd().replace( ";", "" )
DIR_RESOURCES_LIB = "/".join( [DIR_HOME, "resources", "lib"] )
sys.path.insert(0, xbmc.translatePath(DIR_RESOURCES_LIB) )
gives
C:\Program Files\XBMC\scripts\<scriptname>/resources/lib
which is ugly, but it still works on win32 and xbox (don't know about others)
HOME_DIR is only really used as a base for relative subdirs and it doesnt upset
translatePath() but any recommendations to get a path all using the same divider ?
Note:: xbmc.Language( DIR_HOME ) which appends 'resources' must produce:
C:\Program Files\XBMC\scripts\<scriptname>/resources/
Is this likely to be a future problem ?
BBB
ie.
DIR_HOME = os.getcwd().replace( ";", "" )
DIR_RESOURCES_LIB = "/".join( [DIR_HOME, "resources", "lib"] )
sys.path.insert(0, xbmc.translatePath(DIR_RESOURCES_LIB) )
gives
C:\Program Files\XBMC\scripts\<scriptname>/resources/lib
which is ugly, but it still works on win32 and xbox (don't know about others)
HOME_DIR is only really used as a base for relative subdirs and it doesnt upset
translatePath() but any recommendations to get a path all using the same divider ?
Note:: xbmc.Language( DIR_HOME ) which appends 'resources' must produce:
C:\Program Files\XBMC\scripts\<scriptname>/resources/
Is this likely to be a future problem ?
BBB