Code: Select all
os.getcwd()
I have also tried using xbmc.validatePath and xbmc.translatePath to no avail. I am looking to get a response such as E:\xbmc.
In the log I see:
Code: Select all
NOTICE: Q:// is mapped to: E:\xbmc
Thank you for the help.
Code: Select all
os.getcwd()
Code: Select all
NOTICE: Q:// is mapped to: E:\xbmc
Code: Select all
import xbmc
import os
print "OS.CURRENT.DIRECTORY: " + os.getcwd()
print "XBMC.SPECIAL.XBMC: " + xbmc.translatePath( "special://xbmc" )
print "XBMC.SPECIAL.HOME: " + xbmc.translatePath( "special://home" )
print "XBMC.SPECIAL.PROFILE: " + xbmc.translatePath( "special://profile" )
Code: Select all
xbmc.translatePath( "special://xbmc" )
Code: Select all
xbmc.translatePath( "special://home" )
Code: Select all
if (os.path.exists(xbmc.translatePath("special://xbmc") + "xbmc.log")):
f = open(xbmc.translatePath("special://xbmc") + "xbmc.log", "r")
for line in f:
idx = string.find(line, "The executable running is: ")
if (idx != -1):
return line[idx + 27:string.rfind(line, os.sep) + 1]
Code: Select all
E:\XBMC\
That doesn't seem to work any moremwaterbu wrote:Thanks again for the help, I figured out what I needed to do, posting this here just in case anyone else may find it helpful.
I know it may be a little "too hacky" but I am just opening the log file and reading the file directory from there.
This will return to me:Code: Select all
if (os.path.exists(xbmc.translatePath("special://xbmc") + "xbmc.log")): f = open(xbmc.translatePath("special://xbmc") + "xbmc.log", "r") for line in f: idx = string.find(line, "The executable running is: ") if (idx != -1): return line[idx + 27:string.rfind(line, os.sep) + 1]
Code: Select all
E:\XBMC\
Code: Select all
CharCount = 100 # How many characters you want after 'The executable running is: '
with open(xbmc.translatePath("special://xbmc") + "xbmc.log", "r") as XBMCLOG:
for line in XBMCLOG:
left,sep,right = line.partition("The executable running is: ")
if sep:
XBMCPath = (right[:CharCount])