How difficult is this for a noob?
#1
Hi guys,

Apologies for this, it's not exactly advanced stuff. I've done zero python\XBMC dev and I'm looking for a quick 1-10 difficulty scale here.

I'd like to have a gui option in the Trailers plugin to write the currently selected title to a text file (so I can parse it with an OS-level script which enters a google calendar reminder for myself so I can buy it in 6 months time when it's out).

How difficult do you think this would be?

I am actively researching it, and have already checked out the source but experienced guidance or opinon on implementation tips would be appreciated.

Unless any kind soul could save me hours\days of learning\testing a new language for the sake of a handful of lines? For that I would eternally grateful.

Thanks for your time,

JD
Reply
#2
From my own (limited) python/xbmc plugin experience - I would say the text file part is about a 3, since you can use python libraries for that and might only have to be carefull with the path you are writing to. The gui part I can't answer, although I don't think you can easily hook into the context menu - I once wrote a small plugin/script that took the selected tv show and ran a search on a favorite website of mine to find more episodes form the same series, but I bound it to a keyboard key to activate it. But before you ask: I lost the thing in a harddrive crash, so unfortunately nothing code-wise to help you out.

If you have absolutely no coding experience at all, you will need some time though - it's a bit tricky to debug stuff by outputting debug lines to the log and you will have to play around with python a bit - not a hard language and a good one to start out with, but still ...
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#3
You can hook into a plugin's context menu easily. I'm not sure what "the trailers plugin" means (apple trailers lite?) but if it is a plugin that already has a context menu it only requires a little copy-paste.

The writing part is pretty easy too, you'll do something like
PHP Code:
def write_calender_parsable_file(listitembasepath "c:\\some\\default\\path")
    
filename "foo.txt" // or whatever naming scheme fits your parsing script
    // define the absolute path where you want to write your file
    
filepath os.path.join(basepathfilename)
    
// this creates a file.  It will overwrite any file with the same name without asking
    
txtfile open(filepath'w')
    
// write the trailer's label to the contents of the file, then close it.
    
txtfile.write(listitem.getLabel())
    
txtfile.close() 

my advise is to just start and come back with any specific questions.
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
#4
Thumbs Up 
rwparris2, that's exactly what I was hoping for!

Really appreciate that, thank you.

It is the Apple Trailers Lite plugin that I was referring to, apologies for the lack of clarity, I'm new to XBMC and that's the only current plugin that I've found.

I'll be trying it out as soon as I get home.

The only change I'd make is that I'd append to the file rather than overwrite it, but thanks to your guidance, one quick google later and I've got my answer!

Awesome, well happy now.

Thanks again,

JD
Reply

Logout Mark Read Team Forum Stats Members Help
How difficult is this for a noob?0