Can't write script with Eclipse IDE (Unresolved import: xbmc)
#1
Hi!

I try write script for XBMC on Eclipse (in Windows PC)

I downloaded latest version of xbmc (windows installer), downloaded Eclipse Classic, setup PyDev for eclipse (as here http://wiki.xbmc.org/index.php?title=HOW...th_Eclipse )

Download script for watching youtube , put his in C:\Program files\XBMC\scripts\ folder... in XBMC this script works fine...

trying to create a project in eclipse (as here http://wiki.xbmc.org/index.php?title=HOW...ev_Project ) with YouTube script
and i have error:

Unresolved import: xbmcgui
Unresolved import: xbmc

Sad

Where i can find xbmcgui, xbmc? maybe I need somewhere to download them?

Thanks for your help! Sorry for my english = \
Reply
#2
How do you try to run your script?
Within XBMC or within Eclipse?

If it is in Eclipse that won't work, Eclipse does not know about XBMC modules. That the reason why http://wiki.xbmc.org/index.php?title=HOW...h_Eclipsee shows how to use a remote debugger.

- First run your debugger in Eclipse (it will wait until you run the code you added at the beginning of your code) then,
- Run your script/plugin/addon in XBMC. This should stop where we import and run Pydev:
Code:
REMOTE_DBG = True
    if REMOTE_DBG:
    # Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc
    try:
        import pysrc.pydevd as pydevd
        pydevd.settrace('localhost', stdoutToServer=True, stderrToServer=True)
    except ImportError:
        sys.stderr.write("Error: " +
            "You must add org.python.pydev.debug.pysrc to XBMC\system\python\Lib\pysrc")
        sys.exit(1)

Then you can fully use the debugger.
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply
#3
where can I download or how can I make stubbed version of those imports?
Reply
#4
Marx1 Wrote:where can I download or how can I make stubbed version of those imports?
I am not sure why you need it. I have been using Eclipse and Pydev since 2008 for developping scripts/plugin on XBMC and that works fine.
Except you won't have the definition resolution of xbmc modules, you can even run the debugger: http://wiki.xbmc.org/index.php?title=HOW...th_Eclipse

In all the cases you won't run your python script/plugin in eclipse, you have to run it in XBMC (witth a remote debugger attached if you want) in order to run XBMC modules.

A way to potspone that, is to seperate your development which does not need xbmc module, then you will be able to run your script without XBMC.

But the fulll script/plugin integration has to run on XBMC.

Concerning the stub, years ago an emulator has been developped before XBMC was ported on Windows and Platform, this emulator was allowing to run a script without XBMC. The problem is that is as far as I know totally out of date, and would work very well with a plugin.
Image
_____________________________

Repositories Installer: select and install unofficial repositories / TAC.TV: watch videos on TAC.TV
Installer Passion-XBMC: Download and Install Add-ons (pre-Dharma only)

Image
Reply
#5
I don't want to run script in Eclipse, I simply want to have error checking and commands suggestions. Now, if I open script in Eclipse, everything related to xmbc is red underlined because of missing imports
Reply
#6
I'm using this script for module suggestions. You can install from XBMC addon manager.
Reply
#7
Thank you - it's what I wanted!
Reply

Logout Mark Read Team Forum Stats Members Help
Can't write script with Eclipse IDE (Unresolved import: xbmc)0