Development | Add-on development | Python development | HOW-TO:Debug Python Scripts with Eclipse |
Here is a method you can adopt in order to use the Eclipse (multi-platforms) remote debugger with your Python scripts/plugin.
Aug 28, 2013 Now, go back to PhpStorm or your IDE of choice and set a 'breakpoint'. Breakpoints are like markers on a line which tell the debugger to halt the execution of the script at that breakpoint. In PhpStorm, you can simply add breakpoints by clicking the space next to. Enhanced Class Decompiler integrates JD, Jad, FernFlower, CFR, Procyon seamlessly with Eclipse and allows Java developers to debug class files without source code directly. It also integrates with the eclipse class editor, m2e plugin, supports Javadoc, reference search, library source attaching, byte code view and the syntax of JDK8 lambda expression.
Note: Follow this link Debugging Python Scripts on Linux with WinPDB for more information if you prefer to use WinPDB instead.
Note: The information provided herein is also applicable to user with Aptana Studio 3 installation which come pre-installed with pydev. For this case, you can skip to Configure Pydev and Eclipse after the Aptana Studio 3 installation.
Note: in our example Eclipse Galileo (3.5.1) is used
Note: in our example PyDev 1.5.5
This will help in order to have Python code completion (except for XBMC modules)
Use this view for your developments in Python for XBMC
If you do not want to use the default port (usually 5678) you can set it up:
Many developers are accustom to using predefined completions when writing their code (eg. type-ahead). The standard Python completions are enabled by default when using these instructions, but the standard XBMC components will not be recognized appropriately (xbmc, xbmcgui, xbmcplugin, etc).
In order to overcome this, you can run the PyDev Predefined Completions Creator addon and setup Eclipse to reference this file:
Fusion 360 mac torrent. Most of the time when you are doing development, likely that you are running XBMC and Eclipse on the same platform; (The installed debugger described in this article actually can also work with a remote XBMC).<br>Let's say you already have scripts installed in XBMC script folder that you want to create a new PyDev project e.g.
With myscript1 & myscript2 being sub-directories of C:XBMCaddons each containing the Default.py scripts.<br>First you need to define the Python project workspace:
Then proceed to create the Python project:
Assuming you want to add in all the directories under C:XBMCaddons
Your source code is now recognized by Eclipse and you will have access to neat functionality such as code completion, link between source files, etc.
XBMC needs to know where to find the PyDev remote python source file in order to communicate with the remote debugger of Eclipse.
In later versions, you need to have started the debug server from Eclipse at least once for the following folder to show up.
Python source files should be in you Eclipse installation directory:
In our case we use PyDev 1.5.5. With newer versions of PyDev, the directory structure changed.
Look for org.python.pydev.debug (not core)
Instructions for Linux users:
Extended content |
---|
In new Eclipse versions on Linux, the standard eclipse installation (/usr/share/eclipse/plugins) does not contain the pydev files any more.The easiest solution is to install the pydevd-addon. |
The pysrc code that came with Eclipse-pydev does not support XBMC paths (special://.. or Q:/..) and the module would not find them making it impossible to insert breakpoints in such files.
In order to add the support of XBMC paths, you will need to do a simple modification to the file pydevd_file_utils.py consisting on adding a line to each procedure that had a filename parameter (4 procedures in total). Add a line like
The other three procedures are:
of course you need the import directive at the top of the file:
at the beginning of the module..
You have 3 options as below:
I am only going to show you the steps for Option 3:
Use the pydevd-addon as described above. No action necessary. Option 3 does not work on Linux, because /usr/share/kodi/system/python/Lib is ignored.
At the beginning of you Python script/plugin (usually Default.py) add the following code:
If this doesn't work and you are still getting the PYTHONPATH error you can try to:
Replace:
in the code snippet above with:
In the case you have changed the default port you can replace the line with pydevd.settrace by this one:
Development:
Development | Add-on development | Python development | HOW-TO:Debug Python Scripts with Eclipse |
Here is a method you can adopt in order to use the Eclipse (multi-platforms) remote debugger with your Python scripts/plugin.
Aug 28, 2013 Now, go back to PhpStorm or your IDE of choice and set a 'breakpoint'. Breakpoints are like markers on a line which tell the debugger to halt the execution of the script at that breakpoint. In PhpStorm, you can simply add breakpoints by clicking the space next to. Enhanced Class Decompiler integrates JD, Jad, FernFlower, CFR, Procyon seamlessly with Eclipse and allows Java developers to debug class files without source code directly. It also integrates with the eclipse class editor, m2e plugin, supports Javadoc, reference search, library source attaching, byte code view and the syntax of JDK8 lambda expression.
Note: Follow this link Debugging Python Scripts on Linux with WinPDB for more information if you prefer to use WinPDB instead.
Note: The information provided herein is also applicable to user with Aptana Studio 3 installation which come pre-installed with pydev. For this case, you can skip to Configure Pydev and Eclipse after the Aptana Studio 3 installation.
Note: in our example Eclipse Galileo (3.5.1) is used
Note: in our example PyDev 1.5.5
This will help in order to have Python code completion (except for XBMC modules)
Use this view for your developments in Python for XBMC
If you do not want to use the default port (usually 5678) you can set it up:
Many developers are accustom to using predefined completions when writing their code (eg. type-ahead). The standard Python completions are enabled by default when using these instructions, but the standard XBMC components will not be recognized appropriately (xbmc, xbmcgui, xbmcplugin, etc).
In order to overcome this, you can run the PyDev Predefined Completions Creator addon and setup Eclipse to reference this file:
Fusion 360 mac torrent. Most of the time when you are doing development, likely that you are running XBMC and Eclipse on the same platform; (The installed debugger described in this article actually can also work with a remote XBMC).<br>Let's say you already have scripts installed in XBMC script folder that you want to create a new PyDev project e.g.
With myscript1 & myscript2 being sub-directories of C:XBMCaddons each containing the Default.py scripts.<br>First you need to define the Python project workspace:
Then proceed to create the Python project:
Assuming you want to add in all the directories under C:XBMCaddons
Your source code is now recognized by Eclipse and you will have access to neat functionality such as code completion, link between source files, etc.
XBMC needs to know where to find the PyDev remote python source file in order to communicate with the remote debugger of Eclipse.
In later versions, you need to have started the debug server from Eclipse at least once for the following folder to show up.
Python source files should be in you Eclipse installation directory:
In our case we use PyDev 1.5.5. With newer versions of PyDev, the directory structure changed.
Look for org.python.pydev.debug (not core)
Instructions for Linux users:
Extended content |
---|
In new Eclipse versions on Linux, the standard eclipse installation (/usr/share/eclipse/plugins) does not contain the pydev files any more.The easiest solution is to install the pydevd-addon. |
The pysrc code that came with Eclipse-pydev does not support XBMC paths (special://.. or Q:/..) and the module would not find them making it impossible to insert breakpoints in such files.
In order to add the support of XBMC paths, you will need to do a simple modification to the file pydevd_file_utils.py consisting on adding a line to each procedure that had a filename parameter (4 procedures in total). Add a line like
The other three procedures are:
of course you need the import directive at the top of the file:
at the beginning of the module..
You have 3 options as below:
I am only going to show you the steps for Option 3:
Use the pydevd-addon as described above. No action necessary. Option 3 does not work on Linux, because /usr/share/kodi/system/python/Lib is ignored.
At the beginning of you Python script/plugin (usually Default.py) add the following code:
If this doesn't work and you are still getting the PYTHONPATH error you can try to:
Replace:
in the code snippet above with:
In the case you have changed the default port you can replace the line with pydevd.settrace by this one:
Development: