Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
I know it's early, but will we get a label2 and thumbnailImage?
Also this is more for JMarshall, can the list view for a folder set label2 to the number of items in the folder?
If Virtual python get's access to label2, I would set the genre list's label2 to the number of items and wondered if it would be ignored for a folder.
Posts: 26,215
Joined: Oct 2003
Reputation:
187
Nope, it shouldn't be ignored I don't think - not 100% sure though.
I'll probably start a branch shortly with our progress to date.
Cheers,
Jonathan
Posts: 26,215
Joined: Oct 2003
Reputation:
187
2007-08-14, 11:24
(This post was last modified: 2007-08-14, 11:29 by jmarshall.)
It works fine - it's the executable that I run, after all.
Just Add Source -> Browse -> Add Plugin, and browse to wherever you have the plugin. Alternatively, just click Add Plugin then OK directly and it'll add the plugins folder as a source, so you can experiment with different ones.
EDIT: Note that with the AMT script, it'll only work at this point if you add source to the script itself, rather than a sub category. This is a minor issue that will be resolved.
And yes, currently plugins just provide the listitems, though what the script actually does is pretty much up to it - I'm not sure what will happen if you try invoking windows etc.
Cheers,
Jonathan
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
2007-08-14, 13:15
(This post was last modified: 2007-08-14, 13:17 by Nuka1195.)
JMarshall, if that wasn't with a complete database, then that may be the reason. I didn't check for a NULL entry in the database. I'll fix it and modify the script to work with your new changes.
One nice thing about the add plugin.. way instead of the special drop in folder, is I can keep the plugin with the main script and keep it upto date version wise easier. Most scripts won't require this but AMT definately will require a main script to create the database, otherwise it could be painfully slow to start.
But, I can alway have the plugin call RunScript() and modify the path from that point on, so either way will work.
Edit: ignore most of the above I finished reading the thread. Will have a play.
Posts: 347
Joined: Jul 2007
Reputation:
4
I have some further ideas: Right now we're having a 10 sec timeout with WaitForSingleObject(). Maybe we should change this and have something like a heartbeat: The script has to call a python function at least every three seconds so the c++ part knows that it didn't crash. Plugins that have to do tasks that take longer than the heartbeat interval can solve this by starting a heartbeat thread.
Any ideas on how we could implement a plugin configuration dialog / management? Or context menu stuff, like a "details" dialog? In my opinion those should somehow be able to integrate with whatever skin the user chooses. And with this, I don't mean WindowXML stuff, where you have to supply an XML for all well-know skins. I mean python functions that bind the plugin to display its information in a pre-defined dialog box with less possibilities.. What do you think?
What about another call back thing: A VirtualPythonFile? So plugins could have a fileItem with a url like python://<script...>?PlayFile=115. Then the plugin itself could manage to play the files.
I'd also like to have access to the PythonFolders via Filemanager. So I could browse AMT or TVL and if I want, copy the trailers, videos, etc. to my HDD. Would that be hard to implement? Sure, this wouldn't be possible with the PythonFiles, but on those special files it could just display an error message.
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
I would like to work on a python method that adds a plugin via a script. My thought was for AMT you need the full script to create the database and cache, so. In settings I would add a button "Install plugin" This would create the AMT folder in plugins/video done via python. The add a source to sources.xml, this would be done by the python method. This also could be done via python, but how would it update without restarting and seems safer from XBMC.
Unbehagen, I suggested a progress dialog controlled by XBMC that had a hook the script could call (maybe the same as your heartbeat). It could only activate after a few seconds, like Programs does when creating the database. Not the busy dialog.
About copying files or downloading them, I thought I would if mode was download, just set the url to the script again, with a download parameter instead of the url to the movie. Then you can go ahead and play the trailer when it finished from python. I don't think it would interfere with anything. If the file was already downloaded which I save in the database I would pass the local path, the script would just check for the file first.
The plugin configuration and context menu. I think two additional methods setPluginButtons(), setContextMenu(). This way you can call them anytime if parameters change. You would set a button or context menu item to run your default.py or another .py file with the appropriate args.
Posts: 347
Joined: Jul 2007
Reputation:
4
Strange. I didn't change anything and now it works. Heisenbug?