What tools do you use to build scripts for XBMC?
#1
Lightbulb 
It has been 3 years since my last Python script and I'm looking at updating one of my scripts and changing the GUI so I thought I'd read the Online Manual to see what's new.changed.

One thing I could not find, or was missing, is an recommended/required tool list... IDEs, modules required specifically for XBMC (and how to install them), etc. There is a Python Resources section but it does not get someone started by explaining things, it is just a list of links.

If everyone gives input on this thread I can put together some info to update the manual.

Please post the tools you use, and how you use them.

Please be specific on the tool, debug/test methods - including GUI creation.

thx
I'm not an expert but I play one at work.
Reply
#2
First things first, what's your development platform? If you've been out of it for a couple years (as I was), then you may be used to developing for XBox only.

The ports are amazing these days. Linux, Windows, and Mac versions all work great, so there's no longer a need for a debug emulator. Write your script to work on your development machine, and it'll probably work on XBox, too (only exception being some external libraries, like pysqlite, which are easier to get working on a PC than on the XBox).

Apart from that, I don't have any great advice for you. I do all my programming in EditPad Pro (a souped-up Notepad).

There is a new start page for Python Development on the Wiki. It doesn't recommend development tools, but if you decide to make a page for that, you might want to link it from there (in addition to the other page you mentioned).
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#3
I plan on trying to make my scripts universal for all PC platforms, but I will either use Ubuntu or Windows to develop them. Does not matter to me which.

I was hoping to put info into the wiki like...

Will using a GUI tool like GLADE work?
What will work natively in XBMC.
What XBMC specific libraries will be needed for an XBMC/Python GUI to work.
I'm not an expert but I play one at work.
Reply
#4
The only XBMC specific libraries needed are xbmc, xbmcgui, and xbmcplugin, which are all available in any XBMC installation. You don't need to do anything to install them.

As far as what will work natively in XBMC...that would be really useful information. I've been told (and added in the wiki) that XBMC includes all of the Python 2.4 built-ins and standard modules.

You can get most external libraries designed for Python 2.4 to work, but (as I said earlier) I know for a fact that sqlite2 for Python 2.4 does not work right out of the box. The Apple Movie Trailers guys got a version of it working, and I would love to know exactly how they did it, but there's certainly some limitations and it would be good to document those.

I can't comment on GUI tools. I would guess they won't work, since XBMC uses its own custom GUI framework, but I can't back that up with anything.
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#5
Alexpoet Wrote:I can't comment on GUI tools. I would guess they won't work, since XBMC uses its own custom GUI framework, but I can't back that up with anything.

I figured this, and this is my main concern. GUI is sometimes the most difficult to layout when you have a lot on screen, as I plan to. IMO, we really need to be able to use a standard GUI toolset.
I'm not an expert but I play one at work.
Reply
#6
There is support for building your GUI in XML, as you may have seen.

http://wiki.xbmc.org/?title=WindowXML_GUI_Toolkit

That doesn't really answer your concerns, but it might be worth looking into to simplify your project.

I just use Photoshop to build a skin, and place my GUI elements by pixel reference, but that's a huge pain. I don't recommend that method to anybody.
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply
#7
I saw WindowXML and it is nice. I think one huge barrier to entry for complex script interfaces and skins is the lack of a dev kit. I'd imagine (not being a dev) that it would be possible to use tools like Glade if someone made an XBMC library for it?

So anyone think it would it be easier when dealing with complex GUIs and, like in my script's case, very simple back end logic to use Visual Studio and code it in C++?
I'm not an expert but I play one at work.
Reply
#8
Usually when I develop a script for XBMC, I try to implement the code in order to run on all the supported platforms (Xbox, Win, linux and mac).
In most of the cases what you will write in python will run on all of them but when you will manipulate file path, you will need to cover all the case.

Concerning dev tool I agree with Alexpoet, now in order to execute/test your script, you just run it in XBMC. Unfortunately you won't have a debugger, so it the old fashion way with "print".

Concerning the libs for GUI, as Alexpoet said, there are only 3, and all of them of course will come with your XBMC install on your platform.

If you use just Window (in xbmcgui), you will create a GUI writing Python, if you use WindowXML, you will use python and mostly XML (as Skin developers do).
Same thing, only way to test the result, run it in XBMC. You won't have a nice environment where you draw you skin fist like in Java with netbeans or MFC in Visual C++.

I use Eclipse with Pydev module, it is pretty nice for writing Python, but I only use it as an editor and run my test in XBMC.

For the plugin, it is the same except, you won't use the same API (xbmcplugin) and you won't have to deal with GUI developpement since it is 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
#9
What is the purpose of this messageHuh Go do your ads somewhere else please.
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
#10
Temhil,
I feel the issue is the barrier to entry for developing script for XBMC. Unless you already have a very good grasp of Python, coding anything complex is daunting (I've coded simple things and that was tough enough - and I script js & vbs a ton and dabble in a few other languages).

At this point I think it is easier to code it independently of XBMC (.NET, Mono, etc) and then just make calls to XBMC as needed.

I don't see the point in using XBMC Python for anything complex - unless I misunderstand, it seems like there is no advantage to doing so - only disadvantages?
I'm not an expert but I play one at work.
Reply
#11
Livin Wrote:Temhil,
I feel the issue is the barrier to entry for developing script for XBMC. Unless you already have a very good grasp of Python, coding anything complex is daunting (I've coded simple things and that was tough enough - and I script js & vbs a ton and dabble in a few other languages).

At this point I think it is easier to code it independently of XBMC (.NET, Mono, etc) and then just make calls to XBMC as needed.

I don't see the point in using XBMC Python for anything complex - unless I misunderstand, it seems like there is no advantage to doing so - only disadvantages?

The advantage is integration with xbmc...
If you're doing random scripted stuff (backing up files, restarting your server if it goes down, etc) then no, there is no advantage to using python in xbmc. But why would you want to?
What exactly are you wanting to do that is so complex?
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply
#12
Agree with you rwparris2, for coding without xbmc lib needed, means a doing http request, FTP, parsing ... You can do it with any Python Interpreter (just be careful to remain Python 2.4 compliant).
As son as you will need one of the xbmc lib, the only way is run it in xbmc.

Livin, I am not sure waht you mean when you say coding independently? You still talking in Python right?
If you insits a little bit more with Python you will see how it is powerful and how you can actually do pretty complex think with it in few line of code.
If you come from more evolve language (Java, C++ ...) like me, it could be difficult at the beginning because the way if programming are very different. But I can tell you coding in Python is fun and can be very powerful, I only learned Python last year and once beginner phase is passed, I really enjoy it and am I am impressed how amazing what could be done, especially in XBMC.

Form my point of view the main issue is to understand XBMC API in Python and more especially how to use it (WindowXML, difference between script and plugin ...) since it could be difficult to find documentation and code example for beginner.
But I have seen those last month a lot of script/plugin released, means a lot of good examples.
Seriously it worth it.
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
#13
rwparris2 Wrote:The advantage is integration with xbmc...
If you're doing random scripted stuff (backing up files, restarting your server if it goes down, etc) then no, there is no advantage to using python in xbmc. But why would you want to?
What exactly are you wanting to do that is so complex?

The complexity comes in the GUI - layout and controls.

The code logic itself it very simple. It reads in a txt file and creates controls based on the info. The controls send commands via HTTP to another app. Nothing fancy. Here's the current script which was working for nearly 3 years and now is not, not sure why.

I want to expand that script to have better controls onscreen, not just a list. I want to have a page/tab for each room (currently all rooms are together in one big control list - on the right) and all the controls in that room to be onscreen at once with the ability to just cursor over to them... currently each must be selected and a popup window shows.

here's the current screen layout...
Image
I'm not an expert but I play one at work.
Reply
#14
I haven't looked at the code, so I can't tell you how elegant it is to model off, but you should definitely take a look at Nuka's Weather Channel script:

http://www.xbmc.org/forum/showthread.php?t=40338

There's some screenshots on the last couple pages of that thread, so you can get a quick idea what he's doing.

He has a tabbed interface like you're describing, and it wouldn't be a huge stretch to replace his menu structures with control buttons for various light sources (you could even dynamically draw the current light level on each button, if you wanted).

If you want it to look pretty, your script is going to be a lot of work. No matter what sort of tools you've got, building a nice GUI is a pain in the ass.

If you wanted something simpler, I really think you could do a plugin with an initial menu to select rooms (which could easily be provided large thumbnails, for a more attractive look), and then submenus for each room showing the exact same sort of dynamic button art for each adjustable light source.

If it were me, I'd spend my time trying to make a plugin do what I want, but that's probably just because I hate hate HATE building GUIs.
For scripts, script development tools, and documentation, visit my website:
http://www.maskedfox.com/xbmc/
Reply

Logout Mark Read Team Forum Stats Members Help
What tools do you use to build scripts for XBMC?1