2012-03-13, 16:02
Hi,
I have tried many times follow the guide: http://wiki.xbmc.org/index.php?title=HOW...th_Eclipse
But I still haven't been able to debug my add-on scripts.
I already modified like this and also copy all of this source "pysrc" to:
"XBMC\system\python\Lib\pysrc\"
Then I put these code in the start of my add-on script "default.py"
But when I started the debug server and run XBMC along with my script. Then, I got an error and cannot run my script, also the debug mode.
My whole "default.py" looks like this:
When I commented the "remote debug" codes, I can run my add-on script normally (there is no problem with my add-on script).
Is anyone have the same problem or solution for this? Please help
I just cannot start debug mode for my script, don't know if I am missing something. I use python24 and "org.python.pydev.debug_2.4.0.2012020116"
I have tried many times follow the guide: http://wiki.xbmc.org/index.php?title=HOW...th_Eclipse
But I still haven't been able to debug my add-on scripts.
I already modified like this and also copy all of this source "pysrc" to:
"XBMC\system\python\Lib\pysrc\"
Quote:...Code:def _NormFile(filename):
filename = xbmc.translatePath(filename)
try:
The other three procedures are:
def _NormFile(filename):
def NormFileToServer(filename):
def NormFileToClient(filename):
of course you need the import directive at the top of the file:
import xbmc
Then I put these code in the start of my add-on script "default.py"
Code:
REMOTE_DBG = True
# append pydev remote debugger
if REMOTE_DBG:
# Make pydev debugger works for auto reload.
# Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc
try:
import pysrc.pydevd as pydevd
# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console
pydevd.settrace('localhost', stdoutToServer=True, stderrToServer=True)
except ImportError:
sys.stderr.write("Error: " +
"You must add org.python.pydev.debug.pysrc to your PYTHONPATH.")
sys.exit(1)
But when I started the debug server and run XBMC along with my script. Then, I got an error and cannot run my script, also the debug mode.
My whole "default.py" looks like this:
Code:
import os
import sys
from traceback import print_exc
REMOTE_DBG = True
# append pydev remote debugger
if REMOTE_DBG:
# Make pydev debugger works for auto reload.
# Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc
try:
import pysrc.pydevd as pydevd
# stdoutToServer and stderrToServer redirect stdout and stderr to eclipse console
pydevd.settrace('localhost', stdoutToServer=True, stderrToServer=True)
except ImportError:
sys.stderr.write("Error: " +
"You must add org.python.pydev.debug.pysrc to your PYTHONPATH.")
sys.exit(1)
#Find path in the addon folder
RESOURCES_PATH = os.path.join( os.getcwd() , "resources" )
sys.path.append( os.path.join( RESOURCES_PATH, "lib" ) )
#import GUI library from lib
import GUI_Dialog
#Calling method to display GUI
GUI_Dialog.GUIDialog()
#clear modules
sys.modules.clear()
When I commented the "remote debug" codes, I can run my add-on script normally (there is no problem with my add-on script).
Is anyone have the same problem or solution for this? Please help
I just cannot start debug mode for my script, don't know if I am missing something. I use python24 and "org.python.pydev.debug_2.4.0.2012020116"